Thursday, November 30, 2023
2 changes · 17.0
Resolved issues and error corrections
This update fixes critical issues in the marketing automation system that were causing duplicate email traces to be created for the same contact and activity. These duplicates were leading to incorrect campaign statistics and emails being sent multiple times to the same person. The fix addresses timing comparison problems, participant synchronization issues, and campaign duplication scenarios, while also significantly improving test coverage to prevent future regressions.
Original PR description
Several corner cases in marketing automation may lead to duplicate traces
for a given activity / participant pair. This leads notably to statistics
being wrong, as well as traces that are canceled e.g. a mailing sent several
times on the same record uses the same email and is thus ignored once a
first email is sent.
With this task we fix several issues leading to trace duplication, notably
* a datetime comparison failing when comparing datetime.now and sql.now;
* synchornization not taking into account participants already having
traces;
* campaign duplication with synchronization date leading to duplicate
traces;
Tests are added for those use cases, to try to avoid future regressions
as much as possible.
Task-3506681 (MA: Test cleanup)
Task-2981581 (MA: Fix trace duplication and various issues)
Forward-Port-Of: odoo/enterprise#51210
Forward-Port-Of: odoo/enterprise#47413This fix resolves a critical error that occurs when creating credit notes with text-only corrections in Chilean electronic invoicing. The issue happened because the system attempted mathematical calculations on empty fields, causing the process to fail. Users can now successfully create and confirm credit notes for Chilean invoices without encountering system errors.
Original PR description
Steps to reproduce: - Install Accounting and l10n_cl_edi - Switch to a Chilean company (e.g. CL Company) (1) - Activate a foreign currency (e.g. USD) - Create an invoice: * Customer: [a Chilean…
Steps to reproduce: - Install Accounting and l10n_cl_edi - Switch to a Chilean company (e.g. CL Company) (1) - Activate a foreign currency (e.g. USD) - Create an invoice: * Customer: [a Chilean customer] (e.g. Blanco Martin & Asociados EIRL) * Currency: USD * Document Type: (33) Factura Electrónica * Invoice Lines: [a line with a product and a tax] - Confirm the invoice - Add credit note: * Credit Method: Partial Refund * Reason: [any] * Only Text Correction: [checked] - Click on "REVERSE" - Confirm the credit note => A ZeroDivision Error is raised. (2) - Create an invoice: * Customer: [any foreign customer] (e.g. Azure Interior) * Currency: CPL * Document Type: (110) Factura Exportación Electrónica * Invoice Lines: [a line with a product without tax] - Confirm the invoice - Add credit note: * Credit Method: Partial Refund * Reason: [any] * Only Text Correction: [checked] - Click on "REVERSE" - On the credit note, set "(112) Nota de Crédito de Exportación Electrónica" as Document Type - Confirm the credit note => A ZeroDivision Error is raised. Cause: The "Only Text Correction" option is creating a credit note with a line in which only the label matters. All the other values are empty causing the error in some division. opw-3591417 Forward-Port-Of: odoo/enterprise#51689