Sales order correction (#15190)

This commit is contained in:
Charles-Henri Decultot 2018-08-23 07:21:44 +02:00 committed by Nabin Hait
parent 363dd2773e
commit 25712f8d65

View File

@ -611,8 +611,8 @@ def make_sales_invoice(source_name, target_doc=None, ignore_permissions=False):
if source_parent.project:
target.cost_center = frappe.db.get_value("Project", source_parent.project, "cost_center")
if not target.cost_center and target.item_code:
item = get_item_defaults(target.item_code, target.company)
item_group = get_item_group_defaults(target.item_code, target.company)
item = get_item_defaults(target.item_code, source_parent.company)
item_group = get_item_group_defaults(target.item_code, source_parent.company)
target.cost_center = item.get("selling_cost_center") \
or item_group.get("selling_cost_center")