Merge pull request #11397 from rohitwaghchaure/delivery_note_issue_from_so
[Fix] Getting an error while making delivery note from sales order and sales order has no item code
This commit is contained in:
commit
afb63af3b6
@ -477,6 +477,8 @@ def make_delivery_note(source_name, target_doc=None):
|
||||
target.qty = flt(source.qty) - flt(source.delivered_qty)
|
||||
|
||||
item = frappe.db.get_value("Item", target.item_code, ["item_group", "selling_cost_center"], as_dict=1)
|
||||
|
||||
if item:
|
||||
target.cost_center = frappe.db.get_value("Project", source_parent.project, "cost_center") \
|
||||
or item.selling_cost_center \
|
||||
or frappe.db.get_value("Item Group", item.item_group, "default_cost_center")
|
||||
|
Loading…
Reference in New Issue
Block a user