fix(stock): update target field attribute

(cherry picked from commit 7e08154217)
This commit is contained in:
Pandiyan37
2026-02-04 15:19:56 +05:30
committed by Mergify
parent b5b8032ce0
commit 96dfecf0d5
2 changed files with 3 additions and 3 deletions

View File

@@ -139,7 +139,7 @@ class InventoryDimension(Document):
self.source_fieldname = scrub(self.dimension_name)
if not self.target_fieldname:
self.target_fieldname = scrub(self.reference_document)
self.target_fieldname = scrub(self.dimension_name)
def on_update(self):
self.add_custom_fields()

View File

@@ -117,12 +117,12 @@ class TestInventoryDimension(IntegrationTestCase):
inward.load_from_db()
sle_data = frappe.db.get_value(
"Stock Ledger Entry", {"voucher_no": inward.name}, ["shelf", "warehouse"], as_dict=1
"Stock Ledger Entry", {"voucher_no": inward.name}, ["to_shelf", "warehouse"], as_dict=1
)
self.assertEqual(inward.items[0].to_shelf, "Shelf 1")
self.assertEqual(sle_data.warehouse, warehouse)
self.assertEqual(sle_data.shelf, "Shelf 1")
self.assertEqual(sle_data.to_shelf, "Shelf 1")
outward = make_stock_entry(
item_code=item_code,