| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Sales (sale_management)
• Documents (documents) • Discuss (mail) • Invoicing (account) • Accounting (account_accountant) |
| Community Apps Dependencies | Show |
| Lines of code | 3101 |
| Technical Name |
l10n_mx_edi_sale_document |
| License | OPL-1 |
| Website | https://www.vauxoo.com |
| Versions | 16.0 17.0 |
MX EDI Sale Document
Links customer invoices created from CFDI XML documents to existing Sales Orders, using the order reference found in the XML addenda.
Table of contents
What it does
When a CFDI XML is uploaded to the Documents app and processed as a customer invoice, this module extracts the order reference from the XML addenda and searches for a matching Sale Order. If a match is found, the invoice is created from the SO lines instead of the XML data.
Currently supported addenda formats:
- Amazon Mexico — reads the OrderID from the Amazon addenda
- Generic — reads the PedidoNo from the CFDI addenda
The module also adds a company-level setting to block invoice creation when no matching Sale Order is found, preventing orphan invoices that have no SO link.
When no order reference is present in the XML (or no SO matches), the default behavior from l10n_mx_edi_document is preserved: the invoice is created directly from the XML data. This fallback can be disabled with the Require Sale Order setting described below.
Installation
This module requires:
- l10n_mx_edi_document (Manage Mexican Documents)
- sale_management (Sales)
- Odoo Enterprise with the Mexican localization installed
Configuration
Require Sale Order (optional)
To prevent customer invoices from being created without a linked Sale Order:
Go to Settings > Documents
Enable Require Sale Order on Customer Invoices
Save
With this setting enabled, any XML that does not contain a recognized order reference in its addenda (or whose reference does not match an existing SO) will return an error instead of creating an orphan invoice. The document stays in its current folder so the user can create the SO and retry.
Usage
Step 1: Create and confirm a Sale Order
Create a Sale Order for the customer. Make sure the SO name or origin field matches the order reference that will appear in the XML addenda.
Confirm the SO so it has invoiceable lines.
Step 2: Upload the CFDI XML to Documents
Upload the customer's CFDI XML file to the Finance workspace in the Documents app. The system detects it as a Mexican CFDI and assigns the appropriate tags.
Step 3: Process the document
Select the document and trigger the EDI workflow rule. The module extracts the order reference from the addenda, searches for a matching SO by name, origin, and total amount, and creates the invoice from the SO.
The invoice is posted automatically and linked to the Sale Order.
If no matching SO is found and the Require Sale Order setting is disabled, the invoice is created directly from the XML data (standard behavior).
If the setting is enabled and no SO is found, the system shows an error message with the reference it tried to match, and the document is not moved.
Known issues / Roadmap
- Only Amazon and generic (PedidoNo) addenda formats are supported. Contact support if you need a different addenda format.
- The SO matching uses the order name, origin, and total amount. Contact support if you need custom matching rules.
Credits
Authors
- Vauxoo
Contributors
- Andrea Gidalti <andreag@vauxoo.com>
- Luis Torres <luis_t@vauxoo.com>
Maintainers
This module is maintained by Vauxoo.
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