[FIX] website_sale: add conditions to make sure partner's name exists
Reproduction: 1. Install Event, Sales, Website, Contacts 2. Login as Admin, create a new portal user 123, set the password as 123 3. Go to Contacts, find the created user, add a shipping address, leave the name blank 4. Open another tab login as the portal user, place an order 5. At the Address step, Edit the billing address, change the name from empty to “Test Name”, click next 5. An error is thrown cause the new name is not equal to empty value Fix: this fix aimed the conditions we have in the previous PR: https://github.com/odoo/odoo/pull/111708 This change will allow the user to add a name for shipping address at checkout.Without the fix, if you change the name of a shipping address, it won’t be able to get through. This is because of how we manage the shipping address, e.g. shipping address is managed as child partners. For shipping address, the check can_edit_vat is always false. See here: https://github.com/odoo/odoo/blob/14.0/addons/portal/models/res_partner.py Another check, e.g. if shipping is being edited, is added to make sure name/email can be changed for delivery address. For internal user, the editing of shipping address is not blocked because of the `share` check. But the same condition is used to ensure the consistency in case we change how the shipping address is managed in the future. Note: if the data is '' for name for example, the pre-process will convert it to `False`. Thus the edge case that `'' != False` doen't exist anymore Related PR: https://github.com/odoo/odoo/pull/111708 opw-3126325 closes odoo/odoo#128146 Signed-off-by:Antoine Vandevenne (anv) <anv@odoo.com>
Loading