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:
commit
dc7d5853b4
@ -303,8 +303,9 @@ frappe.ui.form.on("Work Order", {
|
|||||||
frm.set_value('sales_order', "");
|
frm.set_value('sales_order', "");
|
||||||
frm.trigger('set_sales_order');
|
frm.trigger('set_sales_order');
|
||||||
erpnext.in_production_item_onchange = true;
|
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]);
|
frm.set_value(field, r.message[field]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -568,11 +568,10 @@ def get_item_details(item, project = None):
|
|||||||
frappe.throw(_("Default BOM for {0} not found").format(item))
|
frappe.throw(_("Default BOM for {0} not found").format(item))
|
||||||
|
|
||||||
bom_data = frappe.db.get_value('BOM', res['bom_no'],
|
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['project'] = project or bom_data.pop("project")
|
||||||
res['allow_alternative_item'] = bom_data.allow_alternative_item
|
res.update(bom_data)
|
||||||
res['transfer_material_against'] = bom_data.transfer_material_against
|
|
||||||
res.update(check_if_scrap_warehouse_mandatory(res["bom_no"]))
|
res.update(check_if_scrap_warehouse_mandatory(res["bom_no"]))
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
@ -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.v11_0.remove_barcodes_field_from_copy_fields_to_variants
|
||||||
erpnext.patches.v12_0.set_task_status
|
erpnext.patches.v12_0.set_task_status
|
||||||
erpnext.patches.v11_0.make_italian_localization_fields # 01-03-2019
|
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.v12_0.update_pricing_rule_fields
|
||||||
erpnext.patches.v11_1.make_job_card_time_logs
|
erpnext.patches.v11_1.make_job_card_time_logs
|
14
erpnext/patches/v12_0/add_item_name_in_work_orders.py
Normal file
14
erpnext/patches/v12_0/add_item_name_in_work_orders.py
Normal 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()
|
Loading…
x
Reference in New Issue
Block a user