Skip to content
Snippets Groups Projects
Commit fe32b54f authored by Katherine Zaoral's avatar Katherine Zaoral
Browse files

[FIX] l10n_ar: add constraint for doctype 99


Add constraint to exclude argentinian document type's 99 from the
generic LATAM constraint that restrict us us to use a debit_note or
invoice internal types documents in an invoice refund.

closes odoo/odoo#64831

Signed-off-by: default avatarJosse Colpaert <jco@openerp.com>
parent b5f6b3c8
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,19 @@ class AccountMove(models.Model):
if not_invoices:
raise ValidationError(_("The selected Journal can't be used in this transaction, please select one that doesn't use documents as these are just for Invoices."))
@api.constrains('type', 'l10n_latam_document_type_id')
def _check_invoice_type_document_type(self):
""" LATAM module define that we are not able to use debit_note or invoice document types in an invoice refunds,
However for Argentinian Document Type's 99 (internal type = invoice) we are able to used in a refund invoices.
In this method we exclude the argentinian document type 99 from the generic constraint """
ar_doctype_99 = self.filtered(
lambda x: x.l10n_latam_country_code == 'AR' and
x.l10n_latam_document_type_id.code == '99' and
x.type in ['out_refund', 'in_refund'])
super(AccountMove, self - ar_doctype_99)._check_invoice_type_document_type()
def _get_afip_invoice_concepts(self):
""" Return the list of values of the selection field. """
return [('1', 'Products / Definitive export of goods'), ('2', 'Services'), ('3', 'Products and Services'),
......
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