[FIX] website_sale_mondialrelay: override shipping partner fields check
Steps to reproduce: 1) Set up mondial relay and publish it 2) Go to /shop, add a product and checkout 3) Choose a pickup location of mondial relay 4) Reload the page 5) Observe an error 'You cannot edit the address of a Point Relais' Reason: a partner was created without mandatory field 'phone` for the shipping address Solution: do not check mandatory fields for mondial relay partners as it is not allowed to edit them closes odoo/odoo#162047 Signed-off-by: Valeriya Chuprina (vchu) <vchu@odoo.com>
This commit is contained in:
@@ -52,6 +52,12 @@ class WebsiteSaleMondialrelay(WebsiteSale):
|
||||
raise UserError(_('You cannot edit the address of a Point Relais®.'))
|
||||
return res
|
||||
|
||||
def _check_shipping_partner_mandatory_fields(self, partner_id):
|
||||
# skip check for mondialrelay partners as the user can not edit them
|
||||
if partner_id.is_mondialrelay:
|
||||
return True
|
||||
return super()._check_shipping_partner_mandatory_fields(partner_id)
|
||||
|
||||
|
||||
class WebsiteSaleDeliveryMondialrelay(WebsiteSaleDelivery):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user