[FIX] website_sale: block employees from updating their billing address
Reproduction: 1. Install Event, Sales, Webiste 2. Login as Admin, go to Website -> Go to website -> Events 3. Click the Open wood event, Register, buy one VIP ticket 4. In Address step, Edit the billing address, change the name to “Test Name”, click next 5. The user name “Mitchell Admin” is changed to “Test Name”, we shouldn’t be able to change the info Reason: In the fix to block name change here: https://github.com/odoo/odoo/commit/d823033ad67702b1b92d27a3f66c7a4ec304c644 we use the can_edit_vat to check if we have existing invoice(s) or SO(s). However, we should block the route that an employee changes the billing address when placing an order. If they are placing an order for external people, it should be done from the back end. Fix: add an extra error case when it's an employee trying to change the name or email address when editing billing address. This is the case when an employee tries to order for external people. They should do it from the back end. They can still buy for themselves without changing the billing address. Also added translation in pot. Edited the test for editing address of log in user, added tests for portal user. Reformat the invoice exsits check for name change to have better readability In website, add render on MockRequest that return a supported type (string e.g.) The adding of can_edit_vat: https://github.com/odoo/odoo/commit/f8b05f52f5ea7f31135f700b0e240ff563204085 Related fix to block the name change: https://github.com/odoo/odoo/commit/d823033ad67702b1b92d27a3f66c7a4ec304c644 A patch to not block the checkout process when name is not set: https://github.com/odoo/odoo/commit/781dbeaccac76a6ec4f4b8cac1b607810697e394 opw-3126325 closes odoo/odoo#111708 Signed-off-by:Antoine Vandevenne (anv) <anv@odoo.com> Co-authored-by:
Jeremy Kersten <jke@odoo.com> Co-authored-by:
Antoine Vandevenne (anv) <anv@odoo.com>
Showing
- addons/website/tools.py 2 additions, 1 deletionaddons/website/tools.py
- addons/website_sale/controllers/main.py 22 additions, 4 deletionsaddons/website_sale/controllers/main.py
- addons/website_sale/i18n/website_sale.pot 9 additions, 0 deletionsaddons/website_sale/i18n/website_sale.pot
- addons/website_sale/tests/test_sale_process.py 30 additions, 5 deletionsaddons/website_sale/tests/test_sale_process.py
Loading