Compare commits
No commits in common. "19.0" and "17.0" have entirely different histories.
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
'name': 'Account Payment: Current Liability Override',
|
'name': 'Account Payment: Current Liability Override',
|
||||||
'version': '19.0.1.0.0',
|
'version': '17.0.1.0.0',
|
||||||
'summary': 'Allow employees to use a Current Liability account (liability_current) as their payable account and process payments correctly.',
|
'summary': 'Allow employees to use a Current Liability account (liability_current) as their payable account and process payments correctly.',
|
||||||
'category': 'Accounting/Accounting',
|
'category': 'Accounting/Accounting',
|
||||||
'author': 'Suherdy Yacob',
|
'author': 'Suherdy Yacob',
|
||||||
|
|||||||
@ -11,8 +11,8 @@ class AccountMove(models.Model):
|
|||||||
if invoice.payment_state == 'paid' and invoice.is_invoice(include_receipts=True):
|
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')
|
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):
|
if term_lines and invoice.currency_id.is_zero(invoice.amount_residual):
|
||||||
payments = (term_lines.matched_debit_ids.debit_move_id.payment_id |
|
payments = (term_lines.matched_debit_ids.debit_move_id.move_id.payment_id |
|
||||||
term_lines.matched_credit_ids.credit_move_id.payment_id)
|
term_lines.matched_credit_ids.credit_move_id.move_id.payment_id)
|
||||||
if any(not p.is_matched for p in payments if p):
|
if any(not p.is_matched for p in payments if p):
|
||||||
invoice.payment_state = invoice._get_invoice_in_payment_state()
|
invoice.payment_state = invoice._get_invoice_in_payment_state()
|
||||||
|
|
||||||
|
|||||||
@ -7,6 +7,7 @@ class ResPartner(models.Model):
|
|||||||
'account.account',
|
'account.account',
|
||||||
company_dependent=True,
|
company_dependent=True,
|
||||||
string="Account Payable",
|
string="Account Payable",
|
||||||
domain="[('account_type', 'in', ('liability_payable', 'liability_current')), ('active', '=', True)]",
|
domain="[('account_type', 'in', ('liability_payable', 'liability_current')), ('deprecated', '=', False)]",
|
||||||
help="This account will be used instead of the default one as the payable account for the current partner. Extended to allow Current Liabilities.",
|
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