mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user