[OU] account_payment_order: avoid the creation of payments on some cases

It might happen when we had the `no_generate_move` marked.
Not an usual case, but we want to avoid the generation of account.payment for this lines.
This commit is contained in:
Enric Tobella
2023-01-12 17:27:24 +01:00
parent 8ad7113c07
commit 4c9020f0eb

View File

@@ -32,6 +32,7 @@ def _insert_account_payments(env):
JOIN account_payment_order apo ON apo.id = bpl.order_id
JOIN account_payment_mode apm ON apm.id = apo.payment_mode_id
LEFT JOIN account_move_line aml ON aml.bank_payment_line_id = bpl.id
WHERE apo.state not in ('uploaded', 'done') or aml.move_id is not null
""",
)
# As the information is asymmetric: N payment lines > 1 bank payment line, but there