From 9a2549dc32acd0f99bb1ed5afd9ad860516598bb Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 3 Jun 2026 21:02:31 +0530 Subject: [PATCH] refactor: minor problems in production plan (backport #55577) (#55595) Co-authored-by: Mihir Kandoi --- .../doctype/production_plan/production_plan.js | 1 + .../doctype/production_plan/production_plan.py | 18 ++++++++---------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.js b/erpnext/manufacturing/doctype/production_plan/production_plan.js index 22c87fe5d6a..2337b8d0246 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.js +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.js @@ -693,6 +693,7 @@ frappe.ui.form.on("Production Plan Sub Assembly Item", { callback: function (r) { if (r.message && r.message.length) { frappe.model.set_value(cdt, cdn, "actual_qty", r.message[0].actual_qty); + frappe.model.set_value(cdt, cdn, "projected_qty", r.message[0].projected_qty); } }, }); diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.py b/erpnext/manufacturing/doctype/production_plan/production_plan.py index fcf6a6c590b..fd798a8262d 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.py +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py @@ -18,6 +18,7 @@ from frappe.utils import ( cint, comma_and, flt, + get_filtered_list_link, get_link_to_form, getdate, now_datetime, @@ -836,7 +837,6 @@ class ProductionPlan(Document): for field in [ "production_item", "item_name", - "qty", "fg_warehouse", "description", "bom_no", @@ -918,9 +918,7 @@ class ProductionPlan(Document): return frappe.flags.mute_messages = False - if doc_list: - doc_list = [get_link_to_form(doctype, p) for p in doc_list] - msgprint(_("{0} created").format(comma_and(doc_list))) + msgprint(_("{0} created").format(get_filtered_list_link(doctype, doc_list))) def create_work_order(self, item): from erpnext.manufacturing.doctype.work_order.work_order import OverProductionError @@ -1094,8 +1092,8 @@ class ProductionPlan(Document): ).format(self.sub_assembly_warehouse) + "

" ) - message += _( - "If you still want to proceed, please disable 'Skip Available Sub Assembly Items' checkbox." + message += _("If you still want to proceed, please disable '{0}' checkbox.").format( + self.meta.get_field("skip_available_sub_assembly_item").label ) frappe.msgprint(message, title=_("Note")) @@ -1830,7 +1828,9 @@ def get_items_for_material_requests(doc, warehouses=None, get_parent_warehouse_d mr_items = new_mr_items if not mr_items: - to_enable = frappe.bold(_("Ignore Existing Projected Quantity")) + to_enable = frappe.bold( + frappe.get_meta("Production Plan").get_field("ignore_existing_ordered_qty").label + ) warehouse = frappe.bold(doc.get("for_warehouse")) message = ( _( @@ -1848,9 +1848,7 @@ def get_items_for_material_requests(doc, warehouses=None, get_parent_warehouse_d def get_materials_from_other_locations(item, warehouses, new_mr_items, company): from erpnext.stock.doctype.pick_list.pick_list import get_available_item_locations - stock_uom, purchase_uom = frappe.db.get_value( - "Item", item.get("item_code"), ["stock_uom", "purchase_uom"] - ) + purchase_uom = frappe.db.get_value("Item", item.get("item_code"), "purchase_uom") locations = get_available_item_locations( item.get("item_code"),