From abcf863ac6e792d58ea70d64e17d77b33c0642be Mon Sep 17 00:00:00 2001 From: Suherdy Yacob Date: Tue, 5 May 2026 20:11:41 +0700 Subject: [PATCH] fix: update liability invoice and partner payable for Odoo 19 --- models/account_move.py | 4 ++-- models/res_partner.py | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/models/account_move.py b/models/account_move.py index e5009af..66b1b2b 100644 --- a/models/account_move.py +++ b/models/account_move.py @@ -11,8 +11,8 @@ class AccountMove(models.Model): if invoice.payment_state == 'paid' and invoice.is_invoice(include_receipts=True): term_lines = invoice.line_ids.filtered(lambda l: l.display_type == 'payment_term' and l.account_id.account_type == 'liability_current') if term_lines and invoice.currency_id.is_zero(invoice.amount_residual): - payments = (term_lines.matched_debit_ids.debit_move_id.move_id.payment_id | - term_lines.matched_credit_ids.credit_move_id.move_id.payment_id) + payments = (term_lines.matched_debit_ids.debit_move_id.payment_id | + term_lines.matched_credit_ids.credit_move_id.payment_id) if any(not p.is_matched for p in payments if p): invoice.payment_state = invoice._get_invoice_in_payment_state() diff --git a/models/res_partner.py b/models/res_partner.py index ea1fd66..213f59b 100644 --- a/models/res_partner.py +++ b/models/res_partner.py @@ -7,7 +7,6 @@ class ResPartner(models.Model): 'account.account', company_dependent=True, string="Account Payable", - domain="[('account_type', 'in', ('liability_payable', 'liability_current')), ('deprecated', '=', False)]", + domain="[('account_type', 'in', ('liability_payable', 'liability_current')), ('active', '=', True)]", help="This account will be used instead of the default one as the payable account for the current partner. Extended to allow Current Liabilities.", - required=True )