[Fix] POS Profile data not set in the sales invoice (#13568)

This commit is contained in:
rohitwaghchaure 2018-04-12 13:37:08 +05:30 committed by Nabin Hait
parent 098b444f6f
commit 2ea593bdd8
2 changed files with 3 additions and 3 deletions

View File

@ -334,7 +334,7 @@ class SalesInvoice(SellingController):
for item in self.get("items"):
if item.get('item_code'):
for fname, val in get_pos_profile_item_details(pos,
frappe._dict(item.as_dict()), pos).items():
frappe._dict(item.as_dict()), pos, True).items():
if (not for_validate) or (for_validate and not item.get(fname)):
item.set(fname, val)

View File

@ -410,7 +410,7 @@ def get_party_item_code(args, item_doc, out):
item_supplier = item_doc.get("supplier_items", {"supplier": args.supplier})
out.supplier_part_no = item_supplier[0].supplier_part_no if item_supplier else None
def get_pos_profile_item_details(company, args, pos_profile=None):
def get_pos_profile_item_details(company, args, pos_profile=None, update_data=False):
res = frappe._dict()
if not pos_profile:
@ -418,7 +418,7 @@ def get_pos_profile_item_details(company, args, pos_profile=None):
if pos_profile:
for fieldname in ("income_account", "cost_center", "warehouse", "expense_account"):
if not args.get(fieldname) and pos_profile.get(fieldname):
if (not args.get(fieldname) or update_data) and pos_profile.get(fieldname):
res[fieldname] = pos_profile.get(fieldname)
if res.get("warehouse"):