Friday, September 27, 2024
2 changes
Resolved issues and error corrections
This fix resolves two critical issues with Mexican electronic invoicing (CFDI) when processing payments for public recipients. Previously, the payment policy was incorrectly set to immediate payment regardless of actual payment terms, and payments could not be signed when using the generic tax ID. These issues are now corrected, allowing businesses to properly process and sign payments for public customer invoices.
Original PR description
**Steps to reproduce:** - Install l10n_mx_edi - Switch to a Mexican company (e.g. ESCUELA KEMPER URGATE) - Create an invoice: * Customer: [a Mexican customer] (e.g. INMOBILIARIA CVA) * CFDI to public: [Checked] * Invoice Date: [Today] * Payment terms: [the following month] (e.g. 30 Days) - Confirm the invoice - Register a payment **Issues:** 1) "Payment Policy" is PUE no matter what the dates are because "CFDI to public" has been checked. 2) It is not possible to sign the payment when the generic rfc (i.e. XAXX010101000) is used. opw-4145716 opw-4127870
This fix resolves an issue where customers paying for subscription invoices through a website portal would encounter errors when multiple companies are configured. The problem occurred because the system was trying to access company information that the customer didn't have permission to view. The fix ensures the correct company context is set before processing invoice payments, allowing customers to successfully complete their subscription payments.
Original PR description
To reproduce the bug: 1. Install the subscription feature on your website. 2. Create a second company and link it to the website. 3. Create a recurring product with the service type. 4. In the…
To reproduce the bug: 1. Install the subscription feature on your website. 2. Create a second company and link it to the website. 3. Create a recurring product with the service type. 4. In the subscription app, create a quotation with the specified product. 5. Preview the invoice for the quotation. 6. Copy the link for the portal invoice and open it in an incognito window. 7. Pay the invoice. You will encounter a TraceBack error depending on the modules installed. This is due to the `company_id` being set to an empty record as a result of how it is computed here: https://github.com/odoo/odoo/blob/17.0/addons/account/models/account_move.py#L696-L698 In our case, `move.journal_id.company_id` (the invoice company) exists, so `self.env.company` (the website company) gets ignored. However, since the public user of the website doesn't have access to the invoice company, the `company_id` is set to an empty record after checking the access rights with `._accessible_branches()[:1]`. opw-3999546