fix(asset): do not validate warehouse on asset purchase

(cherry picked from commit 136466d255)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
This commit is contained in:
Saqib Ansari
2022-03-29 10:47:27 +05:30
committed by mergify-bot
parent 9ffe34757e
commit 00cb0d0294

View File

@@ -245,6 +245,7 @@ class PurchaseInvoice(BuyingController):
def validate_warehouse(self, for_validate=True):
if self.update_stock and for_validate:
<<<<<<< HEAD
for d in self.get("items"):
if not d.warehouse:
frappe.throw(
@@ -252,6 +253,12 @@ class PurchaseInvoice(BuyingController):
"Warehouse required at Row No {0}, please set default warehouse for the item {1} for the company {2}"
).format(d.idx, d.item_code, self.company)
)
=======
for d in self.get('items'):
if not d.warehouse and not d.is_fixed_asset:
frappe.throw(_("Row No {0}: Warehouse is required. Please set a Default Warehouse for Item {1} and Company {2}").
format(d.idx, d.item_code, self.company), exc=WarehouseMissingError)
>>>>>>> 136466d255 (fix(asset): do not validate warehouse on asset purchase)
super(PurchaseInvoice, self).validate_warehouse()