[FIX] auth_signup: access right issues

When another user than administrator opens the mail sending wizard there
is an access right issue. Indeed as sale mail links now contain auth_signup
parameter an access to allow_uninvited config parameter is done. However
this has to be done using sudo because classic users have no access to
config parameters. Fix related to e79eb01a67 .
This commit is contained in:
Darshan Kalola
2017-07-12 09:54:00 +02:00
committed by Thibault Delavallée
parent 1b12e6bbd6
commit cfbbc236ae
+1 -1
View File
@@ -104,7 +104,7 @@ class ResPartner(models.Model):
"""
res = defaultdict(dict)
allow_signup = self.env['ir.config_parameter'].get_param('auth_signup.allow_uninvited', 'False').lower() == 'true'
allow_signup = self.env['ir.config_parameter'].sudo().get_param('auth_signup.allow_uninvited', 'False').lower() == 'true'
for partner in self:
if allow_signup and not partner.user_ids:
partner.signup_prepare()