From f6edd5aa7dd31a3db3ff0775413f3fc522c1f7f2 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Mon, 21 Apr 2025 19:05:16 +0530 Subject: [PATCH 1/6] fix: backslash in url (cherry picked from commit ecf15130bad830e603c3778408e8770fce651783) # Conflicts: # erpnext/stock/doctype/material_request/material_request.json --- .../doctype/production_plan/production_plan.py | 4 +++- .../doctype/material_request/material_request.json | 10 ++++++++-- .../stock/doctype/material_request/material_request.py | 8 +++++--- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.py b/erpnext/manufacturing/doctype/production_plan/production_plan.py index 2e89a191f66..ad5bf5be7d4 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.py +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py @@ -912,9 +912,11 @@ class ProductionPlan(Document): frappe.flags.mute_messages = False + from urllib.parse import quote_plus + if material_request_list: material_request_list = [ - f"""{m.name}""" + f"""{m.name}""" for m in material_request_list ] msgprint(_("{0} created").format(comma_and(material_request_list))) diff --git a/erpnext/stock/doctype/material_request/material_request.json b/erpnext/stock/doctype/material_request/material_request.json index 25c765bbced..b8ca285c19f 100644 --- a/erpnext/stock/doctype/material_request/material_request.json +++ b/erpnext/stock/doctype/material_request/material_request.json @@ -53,13 +53,14 @@ "options": "fa fa-pushpin" }, { + "default": "MAT/MR/.YYYY.-", "fieldname": "naming_series", "fieldtype": "Select", "label": "Series", "no_copy": 1, "oldfieldname": "naming_series", "oldfieldtype": "Select", - "options": "MAT-MR-.YYYY.-", + "options": "MAT-MR-.YYYY.-\nMAT/MR/.YYYY.-", "print_hide": 1, "reqd": 1, "set_only_once": 1 @@ -357,7 +358,11 @@ "idx": 70, "is_submittable": 1, "links": [], +<<<<<<< HEAD "modified": "2023-09-15 12:07:24.789471", +======= + "modified": "2025-04-21 18:36:04.827917", +>>>>>>> ecf15130ba (fix: backslash in url) "modified_by": "Administrator", "module": "Stock", "name": "Material Request", @@ -425,10 +430,11 @@ } ], "quick_entry": 1, + "row_format": "Dynamic", "search_fields": "status,transaction_date", "show_name_in_global_search": 1, "sort_field": "modified", "sort_order": "DESC", "states": [], "title_field": "title" -} \ No newline at end of file +} diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py index 54b3e17641e..c206c232431 100644 --- a/erpnext/stock/doctype/material_request/material_request.py +++ b/erpnext/stock/doctype/material_request/material_request.py @@ -24,14 +24,15 @@ form_grid_templates = {"items": "templates/form_grid/material_request_grid.html" class MaterialRequest(BuyingController): # begin: auto-generated types + # ruff: noqa + # This code is auto-generated. Do not modify anything in this block. from typing import TYPE_CHECKING if TYPE_CHECKING: - from frappe.types import DF - from erpnext.stock.doctype.material_request_item.material_request_item import MaterialRequestItem + from frappe.types import DF amended_from: DF.Link | None company: DF.Link @@ -42,7 +43,7 @@ class MaterialRequest(BuyingController): material_request_type: DF.Literal[ "Purchase", "Material Transfer", "Material Issue", "Manufacture", "Customer Provided" ] - naming_series: DF.Literal["MAT-MR-.YYYY.-"] + naming_series: DF.Literal["MAT-MR-.YYYY.-", "MAT/MR/.YYYY.-"] per_ordered: DF.Percent per_received: DF.Percent scan_barcode: DF.Data | None @@ -70,6 +71,7 @@ class MaterialRequest(BuyingController): transaction_date: DF.Date transfer_status: DF.Literal["", "Not Started", "In Transit", "Completed"] work_order: DF.Link | None + # ruff: noqa # end: auto-generated types def check_if_already_pulled(self): From ad350216663f81dad87198703383972e6841d354 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Tue, 22 Apr 2025 15:22:54 +0530 Subject: [PATCH 2/6] fix: use get_url_to_form instead (cherry picked from commit 7a82b37f7605449aadb0c1a53dfde8bdf64beef7) --- .../manufacturing/doctype/production_plan/production_plan.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.py b/erpnext/manufacturing/doctype/production_plan/production_plan.py index ad5bf5be7d4..03845d656f4 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.py +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py @@ -17,6 +17,7 @@ from frappe.utils import ( comma_and, flt, get_link_to_form, + get_url_to_form, getdate, now_datetime, nowdate, @@ -912,11 +913,9 @@ class ProductionPlan(Document): frappe.flags.mute_messages = False - from urllib.parse import quote_plus - if material_request_list: material_request_list = [ - f"""{m.name}""" + f"""{m.name}""" for m in material_request_list ] msgprint(_("{0} created").format(comma_and(material_request_list))) From a09ab902e5b64b396e455d2a6ed2add7a6892419 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Tue, 22 Apr 2025 15:27:09 +0530 Subject: [PATCH 3/6] fix: revert unintended changes (cherry picked from commit eaaf34cda659f61a13d1fe9f15cb71bc91ba10c0) # Conflicts: # erpnext/stock/doctype/material_request/material_request.json --- .../doctype/material_request/material_request.json | 10 ++++++---- .../stock/doctype/material_request/material_request.py | 8 +++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/erpnext/stock/doctype/material_request/material_request.json b/erpnext/stock/doctype/material_request/material_request.json index b8ca285c19f..88344bad8a7 100644 --- a/erpnext/stock/doctype/material_request/material_request.json +++ b/erpnext/stock/doctype/material_request/material_request.json @@ -53,14 +53,13 @@ "options": "fa fa-pushpin" }, { - "default": "MAT/MR/.YYYY.-", "fieldname": "naming_series", "fieldtype": "Select", "label": "Series", "no_copy": 1, "oldfieldname": "naming_series", "oldfieldtype": "Select", - "options": "MAT-MR-.YYYY.-\nMAT/MR/.YYYY.-", + "options": "MAT-MR-.YYYY.-", "print_hide": 1, "reqd": 1, "set_only_once": 1 @@ -358,11 +357,15 @@ "idx": 70, "is_submittable": 1, "links": [], +<<<<<<< HEAD <<<<<<< HEAD "modified": "2023-09-15 12:07:24.789471", ======= "modified": "2025-04-21 18:36:04.827917", >>>>>>> ecf15130ba (fix: backslash in url) +======= + "modified": "2024-12-16 12:46:02.262167", +>>>>>>> eaaf34cda6 (fix: revert unintended changes) "modified_by": "Administrator", "module": "Stock", "name": "Material Request", @@ -430,11 +433,10 @@ } ], "quick_entry": 1, - "row_format": "Dynamic", "search_fields": "status,transaction_date", "show_name_in_global_search": 1, "sort_field": "modified", "sort_order": "DESC", "states": [], "title_field": "title" -} +} \ No newline at end of file diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py index c206c232431..54b3e17641e 100644 --- a/erpnext/stock/doctype/material_request/material_request.py +++ b/erpnext/stock/doctype/material_request/material_request.py @@ -24,16 +24,15 @@ form_grid_templates = {"items": "templates/form_grid/material_request_grid.html" class MaterialRequest(BuyingController): # begin: auto-generated types - # ruff: noqa - # This code is auto-generated. Do not modify anything in this block. from typing import TYPE_CHECKING if TYPE_CHECKING: - from erpnext.stock.doctype.material_request_item.material_request_item import MaterialRequestItem from frappe.types import DF + from erpnext.stock.doctype.material_request_item.material_request_item import MaterialRequestItem + amended_from: DF.Link | None company: DF.Link customer: DF.Link | None @@ -43,7 +42,7 @@ class MaterialRequest(BuyingController): material_request_type: DF.Literal[ "Purchase", "Material Transfer", "Material Issue", "Manufacture", "Customer Provided" ] - naming_series: DF.Literal["MAT-MR-.YYYY.-", "MAT/MR/.YYYY.-"] + naming_series: DF.Literal["MAT-MR-.YYYY.-"] per_ordered: DF.Percent per_received: DF.Percent scan_barcode: DF.Data | None @@ -71,7 +70,6 @@ class MaterialRequest(BuyingController): transaction_date: DF.Date transfer_status: DF.Literal["", "Not Started", "In Transit", "Completed"] work_order: DF.Link | None - # ruff: noqa # end: auto-generated types def check_if_already_pulled(self): From 982a68b71a7215168ad8075e900582689229ea2b Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Tue, 22 Apr 2025 15:50:02 +0530 Subject: [PATCH 4/6] fix: change get_url_to_form to get_link_to_form (cherry picked from commit 5d07beee61102c2b5ab171dabc62dae6400e56c8) --- .../manufacturing/doctype/production_plan/production_plan.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.py b/erpnext/manufacturing/doctype/production_plan/production_plan.py index 03845d656f4..ddb3a8860ec 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.py +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py @@ -915,8 +915,7 @@ class ProductionPlan(Document): if material_request_list: material_request_list = [ - f"""{m.name}""" - for m in material_request_list + get_link_to_form("Material Request", m.name) for m in material_request_list ] msgprint(_("{0} created").format(comma_and(material_request_list))) else: From 4fba4d49d261826ddfbfe992437330c62cd2fe6a Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Tue, 22 Apr 2025 15:50:51 +0530 Subject: [PATCH 5/6] fix: remove unused import (cherry picked from commit c3d172fac32acb5692f2ca52f98927fb92ad3d1e) --- erpnext/manufacturing/doctype/production_plan/production_plan.py | 1 - 1 file changed, 1 deletion(-) diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.py b/erpnext/manufacturing/doctype/production_plan/production_plan.py index ddb3a8860ec..681abc8ddde 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.py +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py @@ -17,7 +17,6 @@ from frappe.utils import ( comma_and, flt, get_link_to_form, - get_url_to_form, getdate, now_datetime, nowdate, From e2f8ca5f875f5f1990147cd837cd9b314ed930d4 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Tue, 22 Apr 2025 16:46:57 +0530 Subject: [PATCH 6/6] chore: resolve conflict --- .../stock/doctype/material_request/material_request.json | 8 -------- 1 file changed, 8 deletions(-) diff --git a/erpnext/stock/doctype/material_request/material_request.json b/erpnext/stock/doctype/material_request/material_request.json index 88344bad8a7..8df61fe7fb8 100644 --- a/erpnext/stock/doctype/material_request/material_request.json +++ b/erpnext/stock/doctype/material_request/material_request.json @@ -357,15 +357,7 @@ "idx": 70, "is_submittable": 1, "links": [], -<<<<<<< HEAD -<<<<<<< HEAD - "modified": "2023-09-15 12:07:24.789471", -======= "modified": "2025-04-21 18:36:04.827917", ->>>>>>> ecf15130ba (fix: backslash in url) -======= - "modified": "2024-12-16 12:46:02.262167", ->>>>>>> eaaf34cda6 (fix: revert unintended changes) "modified_by": "Administrator", "module": "Stock", "name": "Material Request",