[FIX]account_payment_order transfer journal

The transfer journal functionality has been broken by commit
65a19492a8

This fix adds transfer journal support to this constraint.
This commit is contained in:
Luc De Meyer
2024-04-14 19:54:17 +02:00
parent 73d857295f
commit 7c7fbfa999

View File

@@ -35,3 +35,16 @@ class AccountPayment(models.Model):
)
)
return res
@api.constrains("payment_method_line_id")
def _check_payment_method_line_id(self):
for pay in self:
transfer_journal = (
pay.payment_order_id.payment_mode_id.transfer_journal_id
or pay.company_id.transfer_journal_id
)
if pay.journal_id == transfer_journal:
continue
else:
super(AccountPayment, pay)._check_payment_method_line_id()
return