From eea0eff001e7a500f6c65c37a0cb2ed9e7a25886 Mon Sep 17 00:00:00 2001 From: Ejaaz Khan <67804911+iamejaaz@users.noreply.github.com> Date: Mon, 13 Jan 2025 11:56:59 +0530 Subject: [PATCH] fix: ui issues across multiple pages (#45224) * fix: ui issues across multiple pages * refactor: change cur_from to frm --- .../doctype/production_plan/production_plan.json | 5 +++-- erpnext/manufacturing/doctype/work_order/work_order.js | 1 - .../subcontracting_order/subcontracting_order.js | 10 +++++++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.json b/erpnext/manufacturing/doctype/production_plan/production_plan.json index 25b61e61497..bd2cccddda2 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.json +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.json @@ -199,9 +199,10 @@ }, { "depends_on": "eval:doc.get_items_from && doc.docstatus == 0", + "description": "Get Finished Goods for Manufacture", "fieldname": "get_items", "fieldtype": "Button", - "label": "Get Finished Goods for Manufacture" + "label": "Get Finished Goods" }, { "fieldname": "po_items", @@ -439,7 +440,7 @@ "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], - "modified": "2024-12-04 11:55:03.108971", + "modified": "2025-01-10 17:47:52.207209", "modified_by": "Administrator", "module": "Manufacturing", "name": "Production Plan", diff --git a/erpnext/manufacturing/doctype/work_order/work_order.js b/erpnext/manufacturing/doctype/work_order/work_order.js index b0849e05fe0..61fc5e77eb8 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order.js +++ b/erpnext/manufacturing/doctype/work_order/work_order.js @@ -717,7 +717,6 @@ erpnext.work_order = { ); } ); - consumption_btn.addClass("btn-primary"); } } } diff --git a/erpnext/subcontracting/doctype/subcontracting_order/subcontracting_order.js b/erpnext/subcontracting/doctype/subcontracting_order/subcontracting_order.js index e9513a47597..ffeff01c066 100644 --- a/erpnext/subcontracting/doctype/subcontracting_order/subcontracting_order.js +++ b/erpnext/subcontracting/doctype/subcontracting_order/subcontracting_order.js @@ -254,20 +254,24 @@ erpnext.buying.SubcontractingOrderController = class SubcontractingOrderControll if (doc.docstatus == 1) { if (!["Closed", "Completed"].includes(doc.status)) { if (flt(doc.per_received) < 100) { - cur_frm.add_custom_button( + this.frm.add_custom_button( __("Subcontracting Receipt"), this.make_subcontracting_receipt, __("Create") ); if (me.has_unsupplied_items()) { - cur_frm.add_custom_button( + this.frm.add_custom_button( __("Material to Supplier"), this.make_stock_entry, __("Transfer") ); } } - cur_frm.page.set_inner_btn_group_as_primary(__("Create")); + if (flt(doc.per_received) < 100 && me.has_unsupplied_items()) { + this.frm.page.set_inner_btn_group_as_primary(__("Transfer")); + } else { + this.frm.page.set_inner_btn_group_as_primary(__("Create")); + } } } }