Merge pull request #1018 from tegin/14.0-fix-ou-oirder

[OU] account_payment_order: avoid the creation of payments on some cases
This commit is contained in:
Pedro M. Baeza
2023-01-13 12:16:05 +01:00
committed by GitHub

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