refactor: simplify conditional logic

Command: `sourcery review --fix --enable de-morgan .`
This commit is contained in:
barredterra
2023-12-05 11:22:55 +01:00
parent 5da3e532c9
commit eb9ee3f79b
51 changed files with 104 additions and 85 deletions

View File

@@ -313,7 +313,7 @@ class Asset(AccountsController):
frappe.throw(_("Gross Purchase Amount is mandatory"), frappe.MandatoryError)
if is_cwip_accounting_enabled(self.asset_category):
if not self.is_existing_asset and not (self.purchase_receipt or self.purchase_invoice):
if not self.is_existing_asset and not self.purchase_receipt and not self.purchase_invoice:
frappe.throw(
_("Please create purchase receipt or purchase invoice for the item {0}").format(
self.item_code

View File

@@ -84,7 +84,7 @@ class AssetMovement(Document):
frappe.throw(_("Source and Target Location cannot be same"))
if self.purpose == "Receipt":
if not (d.source_location) and not (d.target_location or d.to_employee):
if not (d.source_location) and not d.target_location and not d.to_employee:
frappe.throw(
_("Target Location or To Employee is required while receiving Asset {0}").format(d.asset)
)