yezyilomo/odoo-rest-api

PUT request always cause error

chris-lsn opened this issue · 1 comments

{ image: '', default_code: '123', name: 'Chris1', description: '', uom_id: 2, seller_ids: { push: [ 27 ] }, responsible_id: 2 }

error: { code: 200, message: 'Odoo Server Error', data: { name: 'builtins.NameError', debug: 'Traceback (most recent call last):\n File "/home/odoo12/odoo/http.py", line 656, in _handle_exception\n return super(JsonRequest, self)._handle_exception(exception)\n File "/home/odoo12/odoo/http.py", line 314, in _handle_exception\n raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])\n File "/home/odoo12/odoo/tools/pycompat.py", line 87, in reraise\n raise value\n File "/home/odoo12/odoo/http.py", line 698, in dispatch\n result = self._call_function(**self.params)\n File "/home/odoo12/odoo/http.py", line 346, in _call_function\n return checked_call(self.db, *args, **kwargs)\n File "/home/odoo12/odoo/service/model.py", line 97, in wrapper\n return f(dbname, *args, **kwargs)\n File "/home/odoo12/odoo/http.py", line 339, in checked_call\n result = self.endpoint(*a, **kw)\n File "/home/odoo12/odoo/http.py", line 941, in __call__\n return self.method(*args, **kw)\n File "/home/odoo12/odoo/http.py", line 519, in response_wrap\n response = f(*args, **kw)\n File "/home/odoo12/odoo/addons/odoo-rest-api/controllers/controllers.py", line 269, in put_model_record\n in data[field].get("push")\n File "/home/odoo12/odoo/addons/odoo-rest-api/controllers/controllers.py", line 268, in <genexpr>\n for rec_id\nNameError: name \'_\' is not defined\n', message: 'name \'_\' is not defined', arguments: [Array], exception_type: 'internal_error' } } }

When I update the many2many/one2many field, it will cause the above error. Without those field types, it works well. Please have a look, Thanks!

Ooh it's a bug, thanks reporting it.