mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-03 21:48:27 +00:00
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:
committed by
mergify-bot
parent
9ffe34757e
commit
00cb0d0294
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user