[FIX] res_partner: bad sudo.
Using sudo on super call can turn into infinite call in odoo. opw:785415
This commit is contained in:
committed by
Goffin Simon
parent
b0acb42f0b
commit
2a9e6e6a3b
@@ -509,7 +509,7 @@ class Partner(models.Model, FormatAddress):
|
||||
result = True
|
||||
# To write in SUPERUSER on field is_company and avoid access rights problems.
|
||||
if 'is_company' in vals and self.user_has_groups('base.group_partner_manager') and not self.env.uid == SUPERUSER_ID:
|
||||
result = super(Partner, self).sudo().write({'is_company': vals.get('is_company')})
|
||||
result = super(Partner, self.sudo()).write({'is_company': vals.get('is_company')})
|
||||
del vals['is_company']
|
||||
result = result and super(Partner, self).write(vals)
|
||||
for partner in self:
|
||||
|
||||
Reference in New Issue
Block a user