mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-29 17:11:33 +02:00
fix: incorrect inventory dimension for material transfer (#47592)
(cherry picked from commit 738cb6a0c1)
Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
@@ -892,7 +892,7 @@ class StockController(AccountsController):
|
|||||||
or sl_dict.actual_qty < 0
|
or sl_dict.actual_qty < 0
|
||||||
and self.get("is_return")
|
and self.get("is_return")
|
||||||
)
|
)
|
||||||
and self.doctype in ["Purchase Invoice", "Purchase Receipt"]
|
and self.doctype in ["Purchase Invoice", "Purchase Receipt", "Stock Entry"]
|
||||||
) or (
|
) or (
|
||||||
(
|
(
|
||||||
sl_dict.actual_qty < 0
|
sl_dict.actual_qty < 0
|
||||||
@@ -902,6 +902,15 @@ class StockController(AccountsController):
|
|||||||
)
|
)
|
||||||
and self.doctype in ["Sales Invoice", "Delivery Note", "Stock Entry"]
|
and self.doctype in ["Sales Invoice", "Delivery Note", "Stock Entry"]
|
||||||
):
|
):
|
||||||
|
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)
|
||||||
|
return
|
||||||
|
|
||||||
sl_dict[dimension.target_fieldname] = row.get(dimension.source_fieldname)
|
sl_dict[dimension.target_fieldname] = row.get(dimension.source_fieldname)
|
||||||
else:
|
else:
|
||||||
fieldname_start_with = "to"
|
fieldname_start_with = "to"
|
||||||
|
|||||||
Reference in New Issue
Block a user