mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-17 10:36:31 +00:00
refactor: simplify conditional logic
Command: `sourcery review --fix --enable de-morgan .`
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user