[FIX] account_payment_order: fix action returned by create_account_payment_line()

create_account_payment_line() is supposed to returned a form view for a
single payment order and a tree view for multiple payment orders. Before
this fix, it would return a tree view if you were payment more than 1
invoices while generating a single payment order, because the list
result_payorder_ids would contain several time the same ID.
This commit is contained in:
Alexis de Lattre
2022-08-10 20:54:09 +02:00
committed by David Ramia
parent e74aa0dd04
commit 018375d4f0
2 changed files with 3 additions and 3 deletions

View File

@@ -9,7 +9,7 @@
{
"name": "Account Payment Order",
"version": "15.0.1.0.3",
"version": "15.0.1.0.4",
"license": "AGPL-3",
"author": "ACSONE SA/NV, "
"Therp BV, "

View File

@@ -52,7 +52,7 @@ class AccountMove(models.Model):
def create_account_payment_line(self):
apoo = self.env["account.payment.order"]
result_payorder_ids = []
result_payorder_ids = set()
action_payment_type = "debit"
for move in self:
if move.state != "posted":
@@ -90,7 +90,7 @@ class AccountMove(models.Model):
move._prepare_new_payment_order(payment_mode)
)
new_payorder = True
result_payorder_ids.append(payorder.id)
result_payorder_ids.add(payorder.id)
action_payment_type = payorder.payment_type
count = 0
for line in applicable_lines.filtered(