[Fix] Item name and description in production order (#11723)

* fetch item name and description from bom

* Update production_order.py

* patch added

* Update set_item_name_in_production_order.py
This commit is contained in:
Shreya Shah 2017-11-27 12:02:13 +05:30 committed by Nabin Hait
parent ab5e77ecf1
commit e3d6d21ec5
3 changed files with 15 additions and 1 deletions

View File

@ -441,6 +441,8 @@ class ProductionOrder(Document):
for item in sorted(item_dict.values(), key=lambda d: d['idx']):
self.append('required_items', {
'item_code': item.item_code,
'item_name': item.item_name,
'description': item.description,
'required_qty': item.qty,
'source_warehouse': item.source_warehouse or item.default_warehouse
})

View File

@ -461,4 +461,5 @@ execute:frappe.delete_doc_if_exists("DocType", "Program Fee")
erpnext.patches.v9_0.update_employee_loan_details
erpnext.patches.v9_2.delete_healthcare_domain_default_items
erpnext.patches.v9_2.rename_translated_domains_in_en
erpnext.patches.v9_2.repost_reserved_qty_for_production
erpnext.patches.v9_2.repost_reserved_qty_for_production
erpnext.patches.v9_2.set_item_name_in_production_order

View File

@ -0,0 +1,11 @@
import frappe
def execute():
frappe.db.sql("""
update `tabBOM Item` bom, `tabProduction Order Item` po_item
set po_item.item_name = bom.item_name,
po_item.description = bom.description
where po_item.item_code = bom.item_code
and (po_item.item_name is null or po_item.description is null)
""")