Mexique¶
Note
This documentation is written assuming that you follow and know the official documentation regarding Invoicing, Sales and Accounting and that you have experience working with odoo on such areas, we are not intended to put here procedures that are already explained on those documents, just the information necessary to allow you use odoo in a Company with the country « Mexico » set.
Introduction¶
Le module de localisation mexicain est composé de 3 modules:
l10n_mx: All basic data to manage the accounting, taxes and the chart of account, this proposed chart of account installed is a intended copy of the list of group codes offered by the SAT.
l10n_mx_edi: All regarding to electronic transactions, CFDI 3.2 and 3.3, payment complement, invoice addendum.
l10n_mx_reports: Tous les rapports électroniques obligatoires pour la comptabilité électronique sont ici (application de comptabilité requise).
With the Mexican localization in Odoo you will be able not just to comply with the required features by law in México but to use it as your accounting and invoicing system due to all the set of normal requirements for this market, becoming your Odoo in the perfect solution to administer your company in Mexico.
Configuration¶
Astuce
Après la configuration, nous vous donnerons le processus pour tout tester, essayez de suivre pas à pas afin de ne pas perdre de temps sur la résolution de problèmes de débogage. Dans n’importe quelle étape, vous pouvez revenir en arrière et essayer à nouveau.
1. Install the Mexican Accounting Localization¶
Pour cela, allez dans Applications et recherchez le Mexique. Cliquez ensuite sur Installer.
Astuce
Lorsque vous créez une base de données à partir de www.odoo.com, et que vous choisissez le Mexique comme pays lors de la création de votre compte, la localisation mexicaine sera automatiquement installée.
2. Electronic Invoices (CDFI 3.2 and 3.3 format)¶
To enable this requirement in Mexico go to configuration in accounting Go in and enable the option on the image with this you will be able to generate the signed invoice (CFDI 3.2 and 3.3) and generate the payment complement signed as well (3.3 only) all fully integrate with the normal invoicing flow in Odoo.
3. Set you legal information in the company¶
First, make sure that your company is configured with the correct data. Go in and enter a valid address and VAT for your company. Don’t forget to define a mexican fiscal position on your company’s contact.
Astuce
If you want use the Mexican localization on test mode, you can put any known address inside Mexico with all fields for the company address and set the vat to EKU9003173C9.
Avertissement
From a legal point of view, a Mexican company must use the local currency (MXN). Therefore, Odoo does not provide features to manage an alternative configuration. If you want to manage another currency, let MXN be the default currency and use price list instead.
4. Set the proper « Fiscal Position » on the partner that represent the company¶
Go In the same form where you are editing the company save the record in order to set this form as a readonly and on readonly view click on the partner link, then edit it and set in the Invoicing tab the proper Fiscal Information (for the Test Environment this must be 601 - General de Ley Personas Morales, just search it as a normal Odoo field if you can’t see the option).
5. Activer CFDI version 3.3¶
Avertissement
Ces étapes ne sont nécessaires que lorsque vous activez CFDI 3.3 (disponible uniquement à partir de la version 11.0). Si vous ne disposez pas de la version 11.0 ou supérieure sur votre instance SaaS, veuillez demander une mise à niveau et envoyer un ticket au support technique à l’adresse https://www.odoo.com/help.
Activer le mode débogage:
Allez consulter le paramètre technique suivant, sur et configurez le paramètre l10n_mx_edi_cfdi_version sur 3.3 (Si l’entrée portant ce nom n’existe pas, créez-la).
Avertissement
The CFDI 3.2 will be legally possible until November 30th 2017 enable the 3.3 version will be a mandatory step to comply with the new SAT resolution in any new database created since v11.0 released CFDI 3.3 is the default behavior.
Considérations importantes lorsque vous activez le CFDI 3.3¶
Your tax which represent the VAT 16% and 0% must have the « Factor Type » field set to « Tasa ».
You must go to the Fiscal Position configuration and set the proper code (it is the first 3 numbers in the name) for example for the test one you should set 601, it will look like the image.
All products must have for CFDI 3.3 the « SAT code » and the field « Reference » properly set, you can export them and re import them to do it faster.
6. Configure the PAC in order to sign properly the invoices¶
To configure the EDI with the PACs, you can go in . You can choose a PAC within the List of supported PACs on the PAC field and then enter your PAC username and PAC password.
Avertissement
Remember you must sign up in the refereed PAC before hand, that process can be done with the PAC itself on this case we will have two (2) availables Finkok and Solución Factible.
You must process your Private Key (CSD) with the SAT institution before follow this steps, if you do not have such information please try all the « Steps for Test » and come back to this process when you finish the process proposed for the SAT in order to set this information for your production environment with real transactions.
Astuce
If you ticked the box MX PAC test environment there is no need to enter a PAC username or password.
Astuce
Here is a SAT certificate you can use if you want to use the Test Environment for the Mexican Accounting Localization.
:download:` Certificate <files/certificate.cer>` :download:` Certificate Key <files/certificate.key>` - Password: 12345678a
7. Configure the tag in sales taxes¶
This tag is used to set the tax type code, transferred or withhold, applicable to the concept in the CFDI. So, if the tax is a sale tax the « Tag » field should be « IVA », « ISR » or « IEPS ».
Note that the default taxes already has a tag assigned, but when you create a new tax you should choose a tag.
Utilisation et test¶
Facturation¶
Pour utiliser la facturation mexicaine, il vous suffit de faire une facture normale en respectant le comportement habituel d’Odoo.
Voici à quoi doit ressembler une facture correctement signée une fois que vous avez validé votre première facture :
Vous pouvez générer le fichier PDF en cliquant simplement sur le bouton Imprimer de la facture ou en l’envoyant par courrier électronique en suivant la procédure normale dans odoo afin d’envoyer votre facture par courrier électronique.
Voici à quoi doit ressembler la facture électronique une fois que vous l’avez envoyée par email.
Annulation de factures¶
Le processus d’annulation est entièrement lié aux annulations régulières d’Odoo.
Si la facture n’est pas payé.
Go to to the customer invoice journal where the invoice belong to
Check the « Allow cancelling entries » field
Go back to your invoice and click on the button « Cancel Invoice »
For security reasons it is recommendable return the check on the to allow cancelling to false again, then go to the journal and un check such field.
Considérations Légales
A cancelled invoice will automatically cancelled on the SAT.
If you retry to use the same invoice after cancelled, you will have as much cancelled CFDI as you tried, then all those xml are important to maintain a good control of the cancellation reasons.
You must unlink all related payment done to an invoice on odoo before cancel such document, this payments must be cancelled to following the same approach but setting the « Allow Cancel Entries » in the payment itself.
Paiements (disponible uniquement pour CFDI 3.3)¶
Pour générer le complément de paiement, il vous suffit de suivre le processus de paiement normal dans Odoo. Ces considérations sont importantes pour comprendre le comportement.
To generate payment complement the payment term in the invoice must be PPD, because It is the expected behavior legally required for « Cash payment ».
1.1. How can I generate an invoice with payment term `PUE`?
According to the SAT documentation a payment is classified as
PUEif the invoice was agreed to be fully paid before the 17th of the next calendar month (the next month of the CFDI date), any other condition will generate aPPDinvoice.1.2. Comment puis-je avoir cela avec Odoo?
In order to set the appropriate CFDI payment term (PPD or PUE), you can easily set it by using the
Payment Termsdefined in the invoice.Si une facture est générée sans
Termes de paiement, l’attributMetodo PagoseraPUE.Today, if is the first day of the month and is generated an invoice with
Payment Term30 Net DaystheDue Datecalculated is going to be the first day of the following month, this means its before the 17th of the next month, then the attributeMetodoPagowill bePUE.Today, if an invoice is generated with
Payment Term30 Net Daysand theDue Dateis higher than the day 17 of the next month theMetodoPagowill bePPD.If having a
Payment Termwith 2 lines or more, for example30% Advance End of Following Month, this is an installments term, then the attributeMetodoPagowill bePPD.
To test a normal signed payment just create an invoice with payment term
30% Advance End of Following Monthand then register a payment to it.You must print the payment in order to retrieve the PDF properly.
Regarding the « Payments in Advance » you must create a proper invoice with the payment in advance itself as a product line setting the proper SAT code following the procedure on the official documentation given by the SAT in the section Apéndice 2 Procedimiento para la emisión de los CFDI en el caso de anticipos recibidos.
Related to topic 4 it is blocked the possibility to create a Customer Payment without a proper invoice.
Comptabilité¶
La comptabilité pour Mexico est composée, dans Odoo, de 3 rapports:
Plan comptable (appelé et indiqué comme COA).
Balance générale électronique.
Rapport DIOT
1 and 2 are considered as the electronic accounting, and the DIOT is a report only available on the context of the accounting.
You can find all those reports in the original report menu on Accounting app.
Comptabilité électronique (application de comptabilité requise)¶
Plan comptable électronique COA¶
La comptabilité électronique n’a jamais été aussi simple, il suffit d’aller sur et cliquer sur le bouton Exporter pour SAT (XML)
How to add new accounts?
If you add an account with the coding convention NNN.YY.ZZ where NNN.YY is a SAT coding group then your account will be automatically configured.
Example to add an Account for a new Bank account go to and then create a new account on the button « Create » and try to create an account with the number 102.01.99 once you change to set the name you will see a tag automatically set, the tags set are the one picked to be used in the COA on xml.
What is the meaning of the tag?
To know all possible tags you can read the Anexo 24 in the SAT website on the section called Código agrupador de cuentas del SAT.
Astuce
When you install the module l10n_mx and yous Chart of Account rely on it (this happen automatically when you install setting Mexico as country on your database) then you will have the more common tags if the tag you need is not created you can create one on the fly.
Balance générale électronique.¶
Exactly as the COA but with Initial balance debit and credit, once you have your coa properly set you can go to this is automatically generated, and can be exported to XML using the button in the top Export for SAT (XML) with the previous selection of the period you want to export.
All the normal auditory and analysis features are available here also as any regular Odoo Report.
Rapport DIOT (application de comptabilité requise)¶
What is the DIOT and the importance of presenting it SAT
When it comes to procedures with the SAT Administration Service we know that we should not neglect what we present. So that things should not happen in Odoo.
The DIOT is the Informational Statement of Operations with Third Parties (DIOT), which is an an additional obligation with the VAT, where we must give the status of our operations to third parties, or what is considered the same, with our providers.
This applies both to individuals and to the moral as well, so if we have VAT for submitting to the SAT and also dealing with suppliers it is necessary to. submit the DIOT:
When to file the DIOT and in what format?
It is simple to present the DIOT, since like all format this you can obtain it in the page of the SAT, it is the electronic format A-29 that you can find in the SAT website.
Every month if you have operations with third parties it is necessary to present the DIOT, just as we do with VAT, so that if in January we have deals with suppliers, by February we must present the information pertinent to said data.
Where the DIOT is presented?
You can present DIOT in different ways, it is up to you which one you will choose and which will be more comfortable for you than you will present every month or every time you have dealings with suppliers.
The A-29 format is electronic so you can present it on the SAT page, but this after having made up to 500 records.
Once these 500 records are entered in the SAT, you must present them to the Local Taxpayer Services Administration (ALSC) with correspondence to your tax address, these records can be presented in a digital storage medium such as a CD or USB, which once validated you will be returned, so do not doubt that you will still have these records and of course, your CD or USB.
One more fact to know: the Batch load?
When reviewing the official SAT documents on DIOT, you will find the Batch load, and of course the first thing we think is what is that ?, and according to the SAT site is:
The « batch upload » is the conversion of records databases of transactions with suppliers made by taxpayers in text files (.txt). These files have the necessary structure for their application and importation into the system of the Informative Declaration of Operations with third parties, avoiding the direct capture and consequently, optimizing the time invested in its integration for the presentation in time and form to the SAT.
You can use it to present the DIOT, since it is allowed, which will make this operation easier for you, so that it does not exist to avoid being in line with the SAT in regard to the Information Statement of Operations with Third Parties.
Vous pouvez trouver l”information officielle ici.
How Generate this report in odoo?
Go to .
A report view is shown, select last month to report the immediate before month you are or left the current month if it suits to you.
Cliquez sur « Exporter (TXT).
Save in a secure place the downloaded file and go to SAT website and follow the necessary steps to declare it.
Important considerations on your Supplier and Invice data for the DIOT¶
All suppliers must have set the fields on the accounting tab called « DIOT Information », the L10N Mx Nationality field is filled with just select the proper country in the address, you do not need to do anything else there, but the L10N Mx Type Of Operation must be filled by you in all your suppliers.
Il existe 3 options de TVA pour ce rapport : 16 %, 0 % et exonéré. Dans Odoo, une ligne de facturation est considérée comme exonérée si aucune taxe n’est appliquée, les 2 autres taxes sont déjà configurées correctement.
Remember to pay an invoice which represent a payment in advance you must ask for the invoice first and then pay it and reconcile properly the payment following standard odoo procedure.
You do not need all you data on partners filled to try to generate the supplier invoice, you can fix this information when you generate the report itself.
Remember this report only shows the Supplier Invoices that were actually paid.
If some of this considerations are not taken into account a message like this will appear when generate the DIOT on TXT with all the partners you need to check on this particular report, this is the reason we recommend use this report not just to export your legal obligation but to generate it before the end of the month and use it as your auditory process to see all your partners are correctly set.
Extra Recommended features¶
Application Contacts (gratuite)¶
If you want to administer properly your customers, suppliers and addresses this module even if it is not a technical need, it is highly recommended to install.
Multi-devises (application de comptabilité requise)¶
Au Mexique, presque toutes les entreprises envoient et reçoivent des paiements dans des devises différentes. Si vous souhaitez faire de même, vous devez activer la fonctionnalité multidevises et la synchronisation avec ** Banxico **. Cette fonctionnalité vous permet de récupérer automatiquement le taux de change approprié auprès de SAT et de ne pas devoir entrer quotidiennement et manuellement ces informations dans le système.
Allez sur paramètres et activez la fonctionnalité multidevise.
Enabling Explicit errors on the CFDI using the XSD local validator (CFDI 3.3)¶
Frequently you want receive explicit errors from the fields incorrectly set on the xml, those errors are better informed to the user if the check is enable, to enable the Check with xsd feature follow the next steps (with debug mode enabled).
Allez à
Reherchez l’Action « Télécharger le fichier XSD au format CFDI ».
Cliquez sur le bouton « Créer une action contextuelle »
Allez sur le formulaire de la société depuis
Ouvrez l’une de vos sociétés.
Cliquez sur « Action » puis sur « Télécharger le fichier XSD au format CFDI ».
Vous pouvez désormais créer une facture avec n’importe quelle erreur (par exemple un produit sans code, ce qui est assez courant) et une erreur explicite sera affichée à la place d’une erreur générique sans explication.
Note
Si vous voyez une erreur comme celle-ci :
Le CFDI généré n’est pas valide
attribute decl. “TipoRelacion”, attribut “type”: La valeur QName “{http://www.sat.gob.mx/sitio_internet/cfd/catalogos}c_TipoRelacion” ne se résout pas à une définition de type simple., ligne 36
This can be caused because of a database backup restored in another server, or when the XSD files are not correctly downloaded. Follow the same steps as above but:
Choisissez la société dans laquelle l’erreur s’est produite.
Cliquez sur « Action » puis sur « Télécharger le fichier XSD au format CFDI ».
FAQ¶
Message d’erreur (applicable uniquement sur CFDI 3.3):
:9:0:ERROR:SCHEMASV:SCHEMAV_CVC_MINLENGTH_VALID: Element “{http://www.sat.gob.mx/cfd/3}Concepto”, attribute “NoIdentificacion”: [facet “minLength”] The value “” has a length of “0”; this underruns the allowed minimum length of “1”.
:9:0:ERROR:SCHEMASV:SCHEMAV_CVC_PATTERN_VALID: Element “{http://www.sat.gob.mx/cfd/3}Concepto”, attribute “NoIdentificacion”: [facet “pattern”] The value “” is not accepted by the pattern “[^|]{1,100}”.
Astuce
** Solution: ** Vous avez oublié de définir le champ « Référence » approprié dans le produit. Veuillez vous reporter à la fiche du produit et définir correctement votre référence interne.
Message d’erreur
:6:0:ERROR:SCHEMASV:SCHEMAV_CVC_COMPLEX_TYPE_4: Element “{http://www.sat.gob.mx/cfd/3}RegimenFiscal”: The attribute “Regimen” is required but missing.
:5:0:ERROR:SCHEMASV:SCHEMAV_CVC_COMPLEX_TYPE_4: Element “{http://www.sat.gob.mx/cfd/3}Emisor”: The attribute “RegimenFiscal” is required but missing.
Astuce
Solution: You forget to set the proper « Fiscal Position » on the partner of the company, go to customers, remove the customer filter and look for the partner called as your company and set the proper fiscal position which is the kind of business you company does related to SAT list of possible values, antoher option can be that you forgot follow the considerations about fiscal positions.
Yo must go to the Fiscal Position configuration and set the proper code (it is the first 3 numbers in the name) for example for the test one you should set 601, it will look like the image.
Astuce
For testing purposes this value must be 601 - General de Ley Personas Morales which is the one required for the demo VAT.
Message d’erreur
:2:0:ERROR:SCHEMASV:SCHEMAV_CVC_ENUMERATION_VALID: Element “{http://www.sat.gob.mx/cfd/3}Comprobante”, attribute “FormaPago”: [facet “enumeration”] The value “” is not an element of the set {“01”, “02”, “03”, “04”, “05”, “06”, “08”, “12”, “13”, “14”, “15”, “17”, “23”, “24”, “25”, “26”, “27”, “28”, “29”, “30”, “99”}
Astuce
Solution: The payment method is required on your invoice.
Message d’erreur
:2:0:ERROR:SCHEMASV:SCHEMAV_CVC_ENUMERATION_VALID: Element “{http://www.sat.gob.mx/cfd/3}Comprobante”, attribute “LugarExpedicion”: [facet “enumeration”] The value “” is not an element of the set {“00 :2:0:ERROR:SCHEMASV:SCHEMAV_CVC_DATATYPE_VALID_1_2_1: Element “{http://www.sat.gob.mx/cfd/3}Comprobante”, attribute “LugarExpedicion”: “” is not a valid value of the atomic type “{http://www.sat.gob.mx/sitio_internet/cfd/catalogos}c_CodigoPostal”. :5:0:ERROR:SCHEMASV:SCHEMAV_CVC_COMPLEX_TYPE_4: Element “{http://www.sat.gob.mx/cfd/3}Emisor”: The attribute “Rfc” is required but missing.
Astuce
Solution: You must set the address on your company properly, this is a mandatory group of fields, you can go to your company configuration on and fill all the required fields for your address following the step 3. Set you legal information in the company.
Message d’erreur
:2:0:ERROR:SCHEMASV:SCHEMAV_CVC_DATATYPE_VALID_1_2_1: Element “{http://www.sat.gob.mx/cfd/3}Comprobante”, attribute “LugarExpedicion”: “” is not a valid value of the atomic type “{http://www.sat.gob.mx/sitio_internet/cfd/catalogos}c_CodigoPostal”.
Astuce
Solution: Le code postal de l’adresse de votre entreprise n’est pas valide pour le Mexique, corrigez-le.
Message d’erreur
:18:0:ERROR:SCHEMASV:SCHEMAV_CVC_COMPLEX_TYPE_4: Element “{http://www.sat.gob.mx/cfd/3}Traslado”: The attribute “TipoFactor” is required but missing. :34:0:ERROR:SCHEMASV:SCHEMAV_CVC_COMPLEX_TYPE_4: Element “{http://www.sat.gob.mx/cfd/3}Traslado”: The attribute “TipoFactor” is required but missing. », “”)
Astuce
Solution: Set the mexican name for the tax 0% and 16% in your system and used on the invoice.
Your tax which represent the VAT 16% and 0% must have the « Factor Type » field set to « Tasa ».