| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Documents (documents)
• Discuss (mail) • Invoicing (account) • Accounting (account_accountant) |
| Community Apps Dependencies | Show |
| Lines of code | 2948 |
| Technical Name |
l10n_mx_edi_document |
| License | OPL-1 |
| Versions | 16.0 17.0 18.0 |
Manage Mexican Documents
Enhances Odoo's Documents module with an automated solution for managing electronic invoices (CFDIs) in Mexico.
Key Features
- Full integration with Odoo's Documents application for easy file management.
- Validate the CFDI structure and content before generating documents.
- Automatic creation and attachment of customer invoices, vendor bills, credit notes, and payments based on CFDIs.
- Prevention of duplicate record creation.
- Linking to existing records in Odoo to complement fiscal information.
Usage
Go to Documents application, and navigate to the Finance folder (workspace).
Upload the CFDI file of the invoice or payment you want to process by clicking the Upload button or dragging the file into the workspace.
When uploading the document, the partner of the record is established if a contact created in Odoo with the same RFC as the CFDI is found.
It is worth mentioning that if the system parameter mx_documents_omit_partner_generation is configured, and a partner does not exist in Odoo with the same RFC, it will not be assigned.
Once the file is uploaded, the Create EDI Document action will be enabled. By default, the invoice date is taken from the CFDI, but it is possible to configure the date, journal, and account for the new record. Clicking this option will generate the corresponding customer invoice, vendor bill, or payment. The created or associated record (in the case of payments) will be displayed, and a message will be added to the chatter indicating the action performed.
Invoices
Customer Invoices: If you need to import customer invoices and configure the customer journal or customer account, go to Configuration > Settings, check the Import Customer Invoices? option.
The created Customer Invoice will be generated with the configured values.
Vendor Bills: The fields for importing Vendor Bills are visible by default. As with Customer Invoices, you can configure them to create the new record.
Note: For both customer invoices and vendor bills, the selected account will only be applied to the invoice lines if neither the product nor its category has an Income/Expense Account configured, as these take precedence.
Search criteria to prevent invoice duplication
- Fiscal folio: The system checks whether the folio matches any previously created invoice.
If no matches are found by fiscal folio, a secondary search is performed within the non-canceled invoices using the following criteria:
- Partner.
- Total amount.
- Date: The search is performed only within the same day or month/period as the CFDI.
- Just by Folio: If the user created the invoice from a purchase order (PO), the CFDI folio will be used to search for the invoice by the reference field.
- Serie and Fiscal Folio: The search is performed on all invoices.
Notes:
To narrow the invoice search scope based on dates, it is necessary to configure the system parameter documents_force_use_date as day or month. To avoid creating duplicates in scenarios where multiple invoices share the same or similar amounts.
According to the system parameter's value, the search is performed in one of the following ways:
- day: The search is performed on invoices with the same date as the uploaded CFDI.
- month: The search is performed on invoices within the same month as the uploaded CFDI.
To search just by folio it is necessary to configure the system parameter l10n_mx_force_only_folio.
EDI documents for vendor bills and refunds
XML files uploaded from the Documents module can be directly attached to vendor bills and refunds. For a document to be attached, it must meet the following requirements:
- The emitter's RFC must match the company's RFC, and the receiver's RFC must match the customer's RFC.
- The total amount of the vendor bill must match the total in the XML.
- The currency in the vendor bill must match the currency in the XML.
- The fiscal folio in the XML must not belong to any other record in the system.
The document can be attached as follows:
After confirming a vendor bill or refund, click the Attach EDI Document button.
In the wizard, click on Add line to display the available documents.
A second wizard will display the documents belonging to the invoice partner, uploaded through the Documents module. Select one and click the Select button.
The selected document will now appear in the attachment wizard. Click the Relate Document button to attach it.
The document will be attached, and a message will be added in the chatter indicating that the action was performed through the Documents module.
Notes:
If the document cannot be attached, an error will be displayed indicating which requirements are not met, so the user can verify their record or the XML they are trying to attach.
The messages related to the document processing can be viewed from the document inspector by clicking on the Open Chatter icon, as well as when the record is not created (such as when the mx_documents_omit_partner_generation parameter is configured).
- By default, the total in the vendor bill must match the total in the XML.
If the company works with partners where intentional differences are expected (e.g., vendor invoices higher or lower than the registered bill), you can assign the partner category Allow differences in XML total to the vendor.
When this category is set, the system will skip the total validation for that partner.
Partner Creation for Invoices and Payments
There are two scenarios:
Automatic partner creation: When creating a new invoice or payment, the system verifies whether the CFDI's partner already exists by searching for their RFC. If no match is found, a new partner is automatically created.
Manual creation of the new partner: To prevent the automatic creation of a CFDI partner, the parameter mx_documents_omit_partner_generation must be configured. If the partner is not found, the file will be sent to the Incorrect folder, i.e. the invoice will not be created until the partner is manually created and the EDI document creation is attempted again.
Payments
When uploading a CFDI payment, you can configure the payment journal used to create the payment in Odoo. To do this, do the following:
- Go to Configuration > Settings in the Documents application.
- Select the Show Payment Journal? field.
Once you have completed these steps, you will see the field to set the payment journal when you select the CFDI document.
Then the system reads the DoctoRelacionado node to determine which invoice(s) the payment should be linked to. This ensures that the payment is correctly associated with an existing invoice or triggers the creation of a new record if necessary.
There are four possible processing scenarios, each described below. In all cases, a message is added to the chatter indicating the action performed:
A payment complement exists, with an origin invoice: The related payment will be displayed.
An origin invoice exists for the payment, but the complement has not been created: The payment record is created and linked to the corresponding invoice.
Create a payment record without a related invoice: A payment can be created and left available to be associated with an invoice.
Prevent the creation of new payments without related invoices: The CFDI complement is attached to an existing payment.
To disable the creation of new payments, the system parameter mexico_document_avoid_create_payment must be set with True in the value field. If no matching payment is found, the file will be moved to the Without records folder.
Search criteria to prevent payment duplication
- Fiscal folio: It is verified whether the folio matches that of any payment previously created in the system.
- It is verified whether the payment characteristics match an existing one (even if there is no match by fiscal folio).
Credits
Contributors
- Luis Torres <luis_t@vauxoo.com> (Planner/Auditor)
- José Robles <josemanuel@vauxoo.com> (Developer)
Maintainer
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module