I want to inherit the res.users class and override her write method, so I wrote this code:
class User(models.Model): _inherit = 'res.users' is_commercial = fields.Boolean(string= 'is Commercial') @api.multi def write(self, values): super(User, self).write() for partner in self.partner_id: partner.is_commercial = self.is_commercial
and I created this res.partner class too:
class Partner(models.Model): _inherit = 'res.partner' is_commercial = fields.Boolean(string= 'is Commercial')
Now when I try to change the is_commercial content it appears this error:
TypeError: write() got an unexpected keyword argument 'context'
It appears to me that there's a syntaxe error in overriding the write method in res.users class.
Can someone help me? Thanks.