mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 19:29:10 +00:00
fix: inventory dimension for inter company transfer return use case
(cherry picked from commit 38aaba5720)
This commit is contained in:
committed by
Mergify
parent
c30dda3328
commit
6d121b8107
@@ -392,6 +392,9 @@ class AccountsController(TransactionBase):
|
||||
)
|
||||
|
||||
def validate_inter_company_reference(self):
|
||||
if self.get("is_return"):
|
||||
return
|
||||
|
||||
if self.doctype not in ("Purchase Invoice", "Purchase Receipt"):
|
||||
return
|
||||
|
||||
|
||||
@@ -449,8 +449,22 @@ class StockController(AccountsController):
|
||||
"Delivery Note",
|
||||
"Stock Entry",
|
||||
]:
|
||||
if (sl_dict.actual_qty > 0 and self.doctype in ["Purchase Invoice", "Purchase Receipt"]) or (
|
||||
sl_dict.actual_qty < 0 and self.doctype in ["Sales Invoice", "Delivery Note", "Stock Entry"]
|
||||
if (
|
||||
(
|
||||
sl_dict.actual_qty > 0
|
||||
and not self.get("is_return")
|
||||
or sl_dict.actual_qty < 0
|
||||
and self.get("is_return")
|
||||
)
|
||||
and self.doctype in ["Purchase Invoice", "Purchase Receipt"]
|
||||
) or (
|
||||
(
|
||||
sl_dict.actual_qty < 0
|
||||
and not self.get("is_return")
|
||||
or sl_dict.actual_qty > 0
|
||||
and self.get("is_return")
|
||||
)
|
||||
and self.doctype in ["Sales Invoice", "Delivery Note", "Stock Entry"]
|
||||
):
|
||||
sl_dict[dimension.target_fieldname] = row.get(dimension.source_fieldname)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user