Daily updates from Odoo
Monday, October 14, 2024
1 change
Resolved issues and error corrections
This update resolves two critical issues that prevented users from generating Mexican electronic invoices (CFDI) when using the Autozone Addenda feature with sales orders. The fix ensures that date information is properly formatted and handles cases where invoices are created from multiple sales orders, allowing the invoice generation process to complete successfully.
Original PR description
This commit targets to fix two errors: 1.- When trying to create the EDI document for an invoice that has a sale order related to it, when using the Addenda Autozone a traceback appeared. ### Cause:…
This commit targets to fix two errors:
1.- When trying to create the EDI document for
an invoice that has a sale order related to it, when using the Addenda Autozone a traceback appeared.
### Cause:
In attribute t-att-PODATE for the Autozone Addenda we are sending a datetime object
to the strptime function of datetime which in reality it needs to receive a string
object instead. This raises a TypeError
### Solution:
Since the objective is to set a string date, we convert the date_order into a string date
using strftime function from datetime module
### Steps to reproduce:
- Install 'Sales' application and 'l10n_mx_edi' module
- In a company with mexican localization selected go to Sales > Quotations and create a new Order
- Select a contact with the Addenda Autozone selected
- Confirm it and create the corresponding invoice
- Confirm the invoice and generate the CFDI
***
2.- When creating an invoice from multiple sale orders with contact with Addenda Autozone selected, a traceback is raised
### Steps to reproduce:
- Install 'Sales' application and 'l10n_mx_edi' module
- In a company with mexican localization selected go to Sales > Quotations
- Create two orders at least with a contact with Addenda Autozone selected and confirmed them
- In tree view select created orders and click on Create Invoices
- Go to Created Invoice and confirm it and generate the CFDI
### Cause:
In attribute t-att-PODATE for the Autozone Addenda is not expecting a recordset when initializing the
value of sale_id, this causes a ValueError: expected singleton error when retrieving value of date_order
when we create a invoice for multiple sale orders
### Solution:
Initialize sale_id with the first order retrieved to use it