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
This commit is contained in:
ruthra kumar
2024-03-04 15:13:05 +05:30
parent d9a0494fc3
commit e52c4c8f22
2 changed files with 88 additions and 2 deletions

View File

@@ -1880,7 +1880,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