From 91e56988c811914ac5f3ee338a0e36f557de14b5 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 19 Jun 2025 19:33:26 +0530 Subject: [PATCH] fix: target inventory dimension for stock entry (cherry picked from commit d65cb56d662b998198bfc26df60253c528439362) # Conflicts: # erpnext/controllers/stock_controller.py --- erpnext/controllers/stock_controller.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index 2f4c154cb00..7d962ad9023 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -480,6 +480,18 @@ class StockController(AccountsController): ) and self.doctype in ["Sales Invoice", "Delivery Note", "Stock Entry"] ): +<<<<<<< HEAD +======= + if self.doctype == "Stock Entry": + if row.get("t_warehouse") == sl_dict.warehouse and sl_dict.get("actual_qty") > 0: + fieldname = f"to_{dimension.source_fieldname}" + if dimension.source_fieldname.startswith("to_"): + fieldname = f"{dimension.source_fieldname}" + + sl_dict[dimension.target_fieldname] = row.get(fieldname) + continue + +>>>>>>> d65cb56d66 (fix: target inventory dimension for stock entry) sl_dict[dimension.target_fieldname] = row.get(dimension.source_fieldname) else: fieldname_start_with = "to"