Skip to content
Snippets Groups Projects
Commit 781dbeac authored by Ivan Yelizariev's avatar Ivan Yelizariev
Browse files

[FIX] website_sale: allow setting name for delivery


Fixup for d823033a

Portal user should not modify partner's name if an invoice for this partner is
already issued. However, delivery address contact may have empty name, while
eCommerce UI requires filling out the name. This blocks checkout process. Fix it
by allowing name changes, when it's not set.

opw-2981455

closes odoo/odoo#100797

Signed-off-by: default avatarWilliam Braeckman (wbr) <wbr@odoo.com>
parent 26cb902e
No related branches found
No related tags found
No related merge requests found
......@@ -579,7 +579,7 @@ class WebsiteSale(http.Controller):
# prevent name change if invoices exist
if data.get('partner_id'):
partner = request.env['res.partner'].browse(int(data['partner_id']))
if partner.exists() and not partner.sudo().can_edit_vat() and 'name' in data and (data['name'] or False) != (partner.name or False):
if partner.exists() and partner.name and not partner.sudo().can_edit_vat() and 'name' in data and (data['name'] or False) != (partner.name or False):
error['name'] = 'error'
error_message.append(_('Changing your name is not allowed once invoices have been issued for your account. Please contact us directly for this operation.'))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment