From 8e02a9bc28237995c7026b600e4a61d75772b8f9 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 14 Apr 2025 18:54:12 +0200 Subject: [PATCH] fix(Payment Entry): set account type if missing (backport #47069) (#47070) Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com> fix(Payment Entry): set account type if missing (#47069) --- .../doctype/payment_entry/payment_entry.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index 57e36a04bf2..77eeba5cf3a 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -461,15 +461,25 @@ class PaymentEntry(AccountsController): self.set(self.party_account_field, party_account) self.party_account = party_account - if self.paid_from and not (self.paid_from_account_currency or self.paid_from_account_balance): + if self.paid_from and ( + not self.paid_from_account_currency + or not self.paid_from_account_balance + or not self.paid_from_account_type + ): acc = get_account_details(self.paid_from, self.posting_date, self.cost_center) self.paid_from_account_currency = acc.account_currency self.paid_from_account_balance = acc.account_balance + self.paid_from_account_type = acc.account_type - if self.paid_to and not (self.paid_to_account_currency or self.paid_to_account_balance): + if self.paid_to and ( + not self.paid_to_account_currency + or not self.paid_to_account_balance + or not self.paid_to_account_type + ): acc = get_account_details(self.paid_to, self.posting_date, self.cost_center) self.paid_to_account_currency = acc.account_currency self.paid_to_account_balance = acc.account_balance + self.paid_to_account_type = acc.account_type self.party_account_currency = ( self.paid_from_account_currency