Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions account_payment_return/models/payment_return.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,13 @@ def _prepare_return_move_vals(self):

def _prepare_move_line(self, move, total_amount):
self.ensure_one()
account = (
self.payment_method_line_id.payment_account_id
or self.journal_id.default_account_id
)
account = self.payment_method_line_id.payment_account_id
if not account:
raise UserError(_("No account found on the payment method or journal."))
account = (
self.env["account.payment"]
.with_company(self.company_id)
._get_outstanding_account("inbound")
)
return {
"name": move.ref,
"debit": 0.0,
Expand Down