refactor(test): make sure party has USD account

1. Don't reset 'party_account_currency' of SO/PO  upon Payment Entry
cancellation. This happens when there are no payments against a SO/PO

(cherry picked from commit e52c4c8f22)
This commit is contained in:
ruthra kumar
2024-03-04 15:13:05 +05:30
committed by Mergify
parent 6a5a941a5a
commit d6a3b179ec
2 changed files with 88 additions and 2 deletions

View File

@@ -1871,7 +1871,10 @@ class AccountsController(TransactionBase):
advance_paid, precision=self.precision("advance_paid"), currency=advance.account_currency
)
frappe.db.set_value(self.doctype, self.name, "party_account_currency", advance.account_currency)
if advance.account_currency:
frappe.db.set_value(
self.doctype, self.name, "party_account_currency", advance.account_currency
)
if advance.account_currency == self.currency:
order_total = self.get("rounded_total") or self.grand_total