mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-04 04:39:11 +00:00
fix: preserve inventory dimensions when raw materials are reset (#54440)
* fix: preserve inventory dimensions when raw materials are reset
* test: add test case
(cherry picked from commit 0e20e35842)
Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
This commit is contained in:
24
erpnext/patches/v16_0/scr_inv_dimension.py
Normal file
24
erpnext/patches/v16_0/scr_inv_dimension.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import frappe
|
||||
|
||||
from erpnext.stock.doctype.inventory_dimension.inventory_dimension import get_inventory_dimensions
|
||||
|
||||
|
||||
def execute():
|
||||
for dimension in get_inventory_dimensions():
|
||||
if frappe.db.exists(
|
||||
"Custom Field",
|
||||
{
|
||||
"fieldname": dimension.source_fieldname,
|
||||
"dt": "Subcontracting Receipt Supplied Item",
|
||||
"reqd": 1,
|
||||
},
|
||||
):
|
||||
frappe.set_value(
|
||||
"Custom Field",
|
||||
{
|
||||
"fieldname": dimension.source_fieldname,
|
||||
"dt": "Subcontracting Receipt Supplied Item",
|
||||
"reqd": 1,
|
||||
},
|
||||
{"reqd": 0, "mandatory_depends_on": "eval:doc.reference_name"},
|
||||
)
|
||||
Reference in New Issue
Block a user