Wednesday, September 11, 2024
1 change · saas-17.4
Resolved issues and error corrections
Customers linked to a company could be blocked from checkout when a previous sales order used the parent company as the invoice address. This fix ensures the shop uses an invoice address the customer is allowed to use, preventing repeated 403 errors and restoring their ability to complete purchases.
Original PR description
How to reproduce: 1. signup as a fresh user, let's say contact@domain.tld 2. as admin, create a company over the partner, let's say Domain. Open Domain and click on the Contact to check that its type…
How to reproduce: 1. signup as a fresh user, let's say contact@domain.tld 2. as admin, create a company over the partner, let's say Domain. Open Domain and click on the Contact to check that its type is Contact. 3. as Contact, add something to the cart 4. as admin again, find the SO and change the Invoice address to Domain (instead of Domain, Contact) 5. as Contact again, go to the cart and click on Checkout => 403. From now on, if we are effectively locked from buying anything, as odoo will always take the invoice address of the parent company, so if we try to empty cart, or cancell the sale order alltogether and try again, we will still get 403 error. Before this commit, if the last SO invoice address for contact was one of the company, and contact didn't have right to change parent companies invoice address, they were effectively blocked out of our shop, as the checkout gave 403 error. This fix checks that and if partner does not have right to change invoice address of the company, it sets partners invoice adress instead. Fixes: opw-4143122 opw-4166266 opw-4163258 opw-4131725 opw-4139971 opw-4127426 opw-4162361 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr