Merge pull request #22239 from rohitwaghchaure/item-none-not-found-opening-creation-tool-develop

fix: item none not found while making sales invoice using opening inv…
This commit is contained in:
rohitwaghchaure 2020-06-14 15:09:38 +05:30 committed by GitHub
commit c5a2803a1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -582,14 +582,14 @@ class SalesInvoice(SellingController):
def validate_item_code(self):
for d in self.get('items'):
if not d.item_code:
if not d.item_code and self.is_opening == "No":
msgprint(_("Item Code required at Row No {0}").format(d.idx), raise_exception=True)
def validate_warehouse(self):
super(SalesInvoice, self).validate_warehouse()
for d in self.get_item_list():
if not d.warehouse and frappe.get_cached_value("Item", d.item_code, "is_stock_item"):
if not d.warehouse and d.item_code and frappe.get_cached_value("Item", d.item_code, "is_stock_item"):
frappe.throw(_("Warehouse required for stock Item {0}").format(d.item_code))
def validate_delivery_note(self):