summaryrefslogtreecommitdiff
path: root/addons/l10n_latam_invoice_document
diff options
context:
space:
mode:
authorfw-bot <otis@odoo.com>2021-02-26 18:07:31 +0000
committerJosse Colpaert <jco@odoo.com>2021-03-17 13:11:07 +0000
commit109b4b1aaac4d76ef273fb88d27e2b648331a266 (patch)
tree1d07094d0fe4f178029795aead66d4f802187f42 /addons/l10n_latam_invoice_document
parent4779ff2369f1f632429f5305bc4a84db730c3dfe (diff)
[IMP] l10n_latam_invoice_document: Remove l10n_ar constraint on base latam module
Documents with `l10n_latam_document_type_id.code == '99'` just exists on **l10n_ar** https://github.com/odoo/odoo/blob/13.0/addons/l10n_ar/data/l10n_latam.document.type.csv#L74 making this error arise on other localizations which don't use it. This was mistakenly introduced on 7748e0e This method is inherited inside l10n_ar and we add this additional validation. Original PR: https://github.com/odoo/odoo/pull/64831 closes odoo/odoo#66957 Signed-off-by: Josse Colpaert <jco@openerp.com>
Diffstat (limited to 'addons/l10n_latam_invoice_document')
-rw-r--r--addons/l10n_latam_invoice_document/models/account_move.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/addons/l10n_latam_invoice_document/models/account_move.py b/addons/l10n_latam_invoice_document/models/account_move.py
index cccd09cc812..52e4aef66a2 100644
--- a/addons/l10n_latam_invoice_document/models/account_move.py
+++ b/addons/l10n_latam_invoice_document/models/account_move.py
@@ -192,8 +192,7 @@ class AccountMove(models.Model):
for rec in self.filtered('l10n_latam_document_type_id.internal_type'):
internal_type = rec.l10n_latam_document_type_id.internal_type
invoice_type = rec.move_type
- if internal_type in ['debit_note', 'invoice'] and invoice_type in ['out_refund', 'in_refund'] and \
- rec.l10n_latam_document_type_id.code != '99':
+ if internal_type in ['debit_note', 'invoice'] and invoice_type in ['out_refund', 'in_refund']:
raise ValidationError(_('You can not use a %s document type with a refund invoice', internal_type))
elif internal_type == 'credit_note' and invoice_type in ['out_invoice', 'in_invoice']:
raise ValidationError(_('You can not use a %s document type with a invoice', internal_type))