mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-13 09:43:49 +00:00
fix(stock): update target field attribute
(cherry picked from commit 7e08154217)
This commit is contained in:
@@ -139,7 +139,7 @@ class InventoryDimension(Document):
|
|||||||
self.source_fieldname = scrub(self.dimension_name)
|
self.source_fieldname = scrub(self.dimension_name)
|
||||||
|
|
||||||
if not self.target_fieldname:
|
if not self.target_fieldname:
|
||||||
self.target_fieldname = scrub(self.reference_document)
|
self.target_fieldname = scrub(self.dimension_name)
|
||||||
|
|
||||||
def on_update(self):
|
def on_update(self):
|
||||||
self.add_custom_fields()
|
self.add_custom_fields()
|
||||||
|
|||||||
@@ -117,12 +117,12 @@ class TestInventoryDimension(IntegrationTestCase):
|
|||||||
inward.load_from_db()
|
inward.load_from_db()
|
||||||
|
|
||||||
sle_data = frappe.db.get_value(
|
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(inward.items[0].to_shelf, "Shelf 1")
|
||||||
self.assertEqual(sle_data.warehouse, warehouse)
|
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(
|
outward = make_stock_entry(
|
||||||
item_code=item_code,
|
item_code=item_code,
|
||||||
|
|||||||
Reference in New Issue
Block a user