fix: update liability invoice and partner payable for Odoo 19
This commit is contained in:
parent
f10855b57a
commit
abcf863ac6
@ -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()
|
||||
|
||||
|
||||
@ -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
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user