account_payment_liability/models/account_payment.py
2026-03-31 11:56:50 +07:00

21 lines
686 B
Python

from odoo import api, fields, models
class AccountPayment(models.Model):
_inherit = 'account.payment'
destination_account_id = fields.Many2one(
comodel_name='account.account',
string='Destination Account',
store=True, readonly=False,
compute='_compute_destination_account_id',
domain="[('account_type', 'in', ('asset_receivable', 'liability_payable', 'liability_current'))]",
check_company=True
)
@api.model
def _get_valid_payment_account_types(self):
res = super()._get_valid_payment_account_types()
if 'liability_current' not in res:
res.append('liability_current')
return res