Merge pull request #46935 from frappe/mergify/bp/version-15-hotfix/pr-46171

Fix validation mismatch in inventory dimension fields (backport #46171)
This commit is contained in:
ruthra kumar
2025-04-15 11:54:24 +05:30
committed by GitHub
2 changed files with 2 additions and 1 deletions

View File

@@ -398,6 +398,7 @@ def get_inventory_dimensions():
"Inventory Dimension",
fields=[
"distinct target_fieldname as fieldname",
"source_fieldname",
"reference_document as doctype",
"validate_negative_stock",
],

View File

@@ -92,7 +92,7 @@ class StockReconciliation(StockController):
dimensions = get_inventory_dimensions()
for dimension in dimensions:
for row in self.items:
if not row.batch_no and row.current_qty and row.get(dimension.get("fieldname")):
if not row.batch_no and row.current_qty and row.get(dimension.get("source_fieldname")):
frappe.throw(
_(
"Row #{0}: You cannot use the inventory dimension '{1}' in Stock Reconciliation to modify the quantity or valuation rate. Stock reconciliation with inventory dimensions is intended solely for performing opening entries."