feat: make material transfer warehouse validation optional (backport #50461) (#50462)

Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
This commit is contained in:
mergify[bot]
2025-11-11 07:18:41 +00:00
committed by GitHub
parent de14c0838c
commit 1747e83cb1
3 changed files with 44 additions and 33 deletions

View File

@@ -809,6 +809,8 @@ class StockEntry(StockController):
Raises: Raises:
frappe.ValidationError: If warehouses are same and no inventory dimensions differ frappe.ValidationError: If warehouses are same and no inventory dimensions differ
""" """
if frappe.get_single_value("Stock Settings", "validate_material_transfer_warehouses"):
from erpnext.stock.doctype.inventory_dimension.inventory_dimension import get_inventory_dimensions from erpnext.stock.doctype.inventory_dimension.inventory_dimension import get_inventory_dimensions
inventory_dimensions = get_inventory_dimensions() inventory_dimensions = get_inventory_dimensions()

View File

@@ -36,6 +36,7 @@
"show_barcode_field", "show_barcode_field",
"clean_description_html", "clean_description_html",
"allow_internal_transfer_at_arms_length_price", "allow_internal_transfer_at_arms_length_price",
"validate_material_transfer_warehouses",
"serial_and_batch_item_settings_tab", "serial_and_batch_item_settings_tab",
"section_break_7", "section_break_7",
"allow_existing_serial_no", "allow_existing_serial_no",
@@ -530,6 +531,13 @@
"label": "Update Price List Based On", "label": "Update Price List Based On",
"mandatory_depends_on": "eval: doc.auto_insert_price_list_rate_if_missing", "mandatory_depends_on": "eval: doc.auto_insert_price_list_rate_if_missing",
"options": "Rate\nPrice List Rate" "options": "Rate\nPrice List Rate"
},
{
"default": "0",
"description": "If enabled, the source and target warehouse in the Material Transfer Stock Entry must be different else an error will be thrown. If inventory dimensions are present, same source and target warehouse can be allowed but atleast any one of the inventory dimension fields must be different.",
"fieldname": "validate_material_transfer_warehouses",
"fieldtype": "Check",
"label": "Validate Material Transfer Warehouses"
} }
], ],
"icon": "icon-cog", "icon": "icon-cog",
@@ -537,8 +545,8 @@
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"issingle": 1, "issingle": 1,
"links": [], "links": [],
"modified": "2025-10-17 18:32:35.829395", "modified": "2025-11-11 11:35:39.864923",
"modified_by": "hello@aerele.in", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Stock Settings", "name": "Stock Settings",
"owner": "Administrator", "owner": "Administrator",

View File

@@ -67,6 +67,7 @@ class StockSettings(Document):
update_price_list_based_on: DF.Literal["Rate", "Price List Rate"] update_price_list_based_on: DF.Literal["Rate", "Price List Rate"]
use_naming_series: DF.Check use_naming_series: DF.Check
use_serial_batch_fields: DF.Check use_serial_batch_fields: DF.Check
validate_material_transfer_warehouses: DF.Check
valuation_method: DF.Literal["FIFO", "Moving Average", "LIFO"] valuation_method: DF.Literal["FIFO", "Moving Average", "LIFO"]
# end: auto-generated types # end: auto-generated types