[FIX] auth_signup: fix b2c signup

Rather than requiring the user have a name *or* a partner, the check
required the user have a name *and* a partner. The B2C form only has a
name and expects the partner to be created from/via the user, so this
would raise an exception which wouldn't even be bubbled to the user, so
trying to signup would just yield a 500 Server Error when trying to
create an account.
This commit is contained in:
xmo-odoo
2018-05-29 17:17:15 +02:00
committed by GitHub
parent 37eed7c509
commit 50b8934745
+1 -1
View File
@@ -92,7 +92,7 @@ class ResUsers(models.Model):
if not values.get('login'):
raise ValueError(_('Signup: no login given for new user'))
if not values.get('partner_id') or not values.get('name'):
if not values.get('partner_id') and not values.get('name'):
raise ValueError(_('Signup: no name or partner given for new user'))
# create a copy of the template user (attached to a specific partner_id if given)