[FIX] l10n_pe: Add domain 01 for export refunds
In commit 355250d, the domain was adjusted to automatically select the
invoice document type for customers with a RUC and limit others to the
"boleta" document type. This generally holds true, except for export
invoices requiring the 01 document type. This commit addresses the
current restriction, allowing the selection of document type 01 other
than "credit note boleta."
closes odoo/odoo#154511
Related: odoo/enterprise#56465
Signed-off-by: Laurent Smet (las) <las@odoo.com>
This commit is contained in:
@@ -12,8 +12,12 @@ class AccountMove(models.Model):
|
||||
if self.company_id.country_id.code != "PE" or not self.journal_id.l10n_latam_use_documents or self.journal_id.type != "sale":
|
||||
return result
|
||||
result.append(("code", "in", ("01", "03", "07", "08", "20", "40")))
|
||||
if self.partner_id.l10n_latam_identification_type_id.l10n_pe_vat_code != '6':
|
||||
result.append(('id', 'in', (self.env.ref('l10n_pe.document_type08b') | self.env.ref('l10n_pe.document_type02') | self.env.ref('l10n_pe.document_type07b')).ids))
|
||||
if self.partner_id.l10n_latam_identification_type_id.l10n_pe_vat_code != '6' and self.move_type == 'out_invoice':
|
||||
result.append(('id', 'in', (
|
||||
self.env.ref('l10n_pe.document_type08b')
|
||||
| self.env.ref('l10n_pe.document_type02')
|
||||
| self.env.ref('l10n_pe.document_type07b')
|
||||
).ids))
|
||||
return result
|
||||
|
||||
@api.onchange('l10n_latam_document_type_id', 'l10n_latam_document_number')
|
||||
|
||||
Reference in New Issue
Block a user