fix: set stock adjustment account for the raw materials instead of COGS (#19089)

This commit is contained in:
rohitwaghchaure
2019-09-19 11:16:19 +05:30
committed by Anurag Mishra
parent 0d19139acf
commit c719f842bc

View File

@@ -648,7 +648,7 @@ def get_bom_items_as_dict(bom, company, qty=1, fetch_exploded=1, fetch_scrap_ite
item_dict[key] = item
for item, item_details in item_dict.items():
for d in [["Account", "expense_account", "default_expense_account"],
for d in [["Account", "expense_account", "stock_adjustment_account"],
["Cost Center", "cost_center", "cost_center"], ["Warehouse", "default_warehouse", ""]]:
company_in_record = frappe.db.get_value(d[0], item_details.get(d[1]), "company")
if not item_details.get(d[1]) or (company_in_record and company != company_in_record):