fix: incorrect expense account book in purchase return (backport #54681) (#54693)

fix: incorrect expense account book in purchase return

(cherry picked from commit 2a720e7008)

Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
This commit is contained in:
mergify[bot]
2026-05-01 12:47:05 +05:30
committed by GitHub
parent a22d773341
commit 0dade2c38c

View File

@@ -724,6 +724,9 @@ class PurchaseReceipt(BuyingController):
or stock_asset_rbnb
)
if self.is_return and item.expense_account:
loss_account = item.expense_account
cost_center = item.cost_center or frappe.get_cached_value(
"Company", self.company, "cost_center"
)