Skip to content
Snippets Groups Projects
Commit 0f1edf4d authored by Andrea Grazioso (agr-odoo)'s avatar Andrea Grazioso (agr-odoo)
Browse files

[FIX] l10n_cl: unable to issue credit note (vendor bill)

Have a CL company setup
Issue a vendor bill
Then generate the credit note via 'Add Credit Note' wizard
Add a reason and confirm
Error will raise “You can not use a invoice document type with a refund
invoice”

As
https://github.com/odoo/odoo/commit/c9ff9d28ab75c02093ca54d9fbd1d2e203c5ee2e


for the invoice case
we need to add specific logic to handle credit notes in l10n_cl

opw-2801576

closes odoo/odoo#87910

Signed-off-by: default avatarJosse Colpaert <jco@odoo.com>
parent 922370ff
No related branches found
No related tags found
No related merge requests found
......@@ -29,9 +29,14 @@ class AccountMove(models.Model):
if self.company_id.partner_id.l10n_cl_sii_taxpayer_type == '1':
domain += [('code', '!=', '71')] # Companies with VAT Affected doesn't have "Boleta de honorarios Electrónica"
return domain
if self.move_type == 'in_refund':
internal_types_domain = ('internal_type', '=', 'credit_note')
else:
internal_types_domain = ('internal_type', 'in', ['invoice', 'debit_note', 'credit_note', 'invoice_in'])
domain = [
('country_id.code', '=', 'CL'),
('internal_type', 'in', ['invoice', 'debit_note', 'credit_note', 'invoice_in'])]
internal_types_domain,
]
if self.partner_id.l10n_cl_sii_taxpayer_type == '1' and self.partner_id_vat != '60805000-0':
domain += [('code', 'not in', ['39', '70', '71', '914', '911'])]
elif self.partner_id.l10n_cl_sii_taxpayer_type == '1' and self.partner_id_vat == '60805000-0':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment