fix: not able to create the sales invoice without item code (#17612)

This commit is contained in:
rohitwaghchaure 2019-05-15 07:41:44 +05:30 committed by Nabin Hait
parent abcb6aea00
commit 32d91b2c00

View File

@ -506,8 +506,8 @@ class SalesInvoice(SellingController):
for i in dic:
if frappe.db.get_single_value('Selling Settings', dic[i][0]) == 'Yes':
for d in self.get('items'):
if frappe.get_cached_value('Item', d.item_code, 'is_stock_item') == 1 \
and not d.get(i.lower().replace(' ','_')) and not self.get(dic[i][1]):
if (d.item_code and frappe.get_cached_value('Item', d.item_code, 'is_stock_item') == 1
and not d.get(i.lower().replace(' ','_')) and not self.get(dic[i][1])):
msgprint(_("{0} is mandatory for Item {1}").format(i,d.item_code), raise_exception=1)