Merge pull request #16608 from Alchez/hotfix-work-order-item-name

fix(work_order): Add item name in Work Order
This commit is contained in:
Rushabh Mehta 2019-03-22 12:49:05 +05:30 committed by GitHub
commit dc7d5853b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 1676 additions and 1628 deletions

View File

@ -303,8 +303,9 @@ frappe.ui.form.on("Work Order", {
frm.set_value('sales_order', "");
frm.trigger('set_sales_order');
erpnext.in_production_item_onchange = true;
$.each(["description", "stock_uom", "project", "bom_no",
"allow_alternative_item", "transfer_material_against"], function(i, field) {
$.each(["description", "stock_uom", "project", "bom_no", "allow_alternative_item",
"transfer_material_against", "item_name"], function(i, field) {
frm.set_value(field, r.message[field]);
});

File diff suppressed because it is too large Load Diff

View File

@ -568,11 +568,10 @@ def get_item_details(item, project = None):
frappe.throw(_("Default BOM for {0} not found").format(item))
bom_data = frappe.db.get_value('BOM', res['bom_no'],
['project', 'allow_alternative_item', 'transfer_material_against'], as_dict=1)
['project', 'allow_alternative_item', 'transfer_material_against', 'item_name'], as_dict=1)
res['project'] = project or bom_data.project
res['allow_alternative_item'] = bom_data.allow_alternative_item
res['transfer_material_against'] = bom_data.transfer_material_against
res['project'] = project or bom_data.pop("project")
res.update(bom_data)
res.update(check_if_scrap_warehouse_mandatory(res["bom_no"]))
return res

View File

@ -587,5 +587,6 @@ erpnext.patches.v12_0.set_gst_category
erpnext.patches.v11_0.remove_barcodes_field_from_copy_fields_to_variants
erpnext.patches.v12_0.set_task_status
erpnext.patches.v11_0.make_italian_localization_fields # 01-03-2019
erpnext.patches.v12_0.add_item_name_in_work_orders
erpnext.patches.v12_0.update_pricing_rule_fields
erpnext.patches.v11_1.make_job_card_time_logs
erpnext.patches.v11_1.make_job_card_time_logs

View File

@ -0,0 +1,14 @@
import frappe
def execute():
frappe.reload_doc("manufacturing", "doctype", "work_order")
frappe.db.sql("""
UPDATE
`tabWork Order` wo
JOIN `tabItem` item ON wo.production_item = item.item_code
SET
wo.item_name = item.item_name
""")
frappe.db.commit()