Thursday, 7 July 2016

Error when override orm write method in Odoo 8 or 9

If you try override write method with following new API:

         def write(self, vals):
            return super(MyClass, self).write(vals)

You will see the following error:

        Traceback (most recent call last):
          File "/opt/odoo/odoo-server/openerp/", line 530, in _handle_exception
            return super(JsonRequest, self)._handle_exception(exception)
          File "/opt/odoo/odoo-server/openerp/", line 567, in dispatch
            result = self._call_function(**self.params)
          File "/opt/odoo/odoo-server/openerp/", line 303, in _call_function
            return checked_call(self.db, *args, **kwargs)
          File "/opt/odoo/odoo-server/openerp/service/", line 113, in wrapper
            return f(dbname, *args, **kwargs)
          File "/opt/odoo/odoo-server/openerp/", line 300, in checked_call
            return self.endpoint(*a, **kw)
          File "/opt/odoo/odoo-server/openerp/", line 796, in __call__
            return self.method(*args, **kw)
          File "/opt/odoo/odoo-server/openerp/", line 396, in response_wrap
            response = f(*args, **kw)
          File "/opt/odoo/odoo-server/addons/web/controllers/", line 939, in call_button
            action = self._call_kw(model, method, args, {})
          File "/opt/odoo/odoo-server/addons/web/controllers/", line 927, in _call_kw
            return getattr(request.registry.get(model), method)(, request.uid, *args, **kwargs)
          File "/opt/odoo/odoo-server/openerp/", line 241, in wrapper
            return old_api(self, *args, **kwargs)
          File "/opt/odoo/odoo-server/openerp/", line 239, in wrapper
            return new_api(self, *args, **kwargs)
        TypeError: write() got an unexpected keyword argument 'context'

Question: How to resolved mentioned error ?


The method write should be decorated with decorator @api.multi. The mapping new API → old API defined by @api.model is inadequate (argument ids is missing).

Try with following code:

         def write(self, vals):
            return super(MyClass, self).write(vals)

For more details Odoo documentation 

Error: Hash Sum mismatch in GitLab

Recently, I have faced following error during instillation of Gitlab in Ubuntu. odedra@odedra-Lenovo-Z50-70:~$ sudo apt-get install gitla...