fix: inventory dimension for inter company transfer return use case

This commit is contained in:
Rohit Waghchaure
2023-05-13 13:00:05 +05:30
parent 59f9d41756
commit 38aaba5720
3 changed files with 190 additions and 2 deletions

View File

@@ -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: