{"action":"closed","issue":{"url":"https://api.github.com/repos/odoo/odoo/issues/14092","repository_url":"https://api.github.com/repos/odoo/odoo","labels_url":"https://api.github.com/repos/odoo/odoo/issues/14092/labels{/name}","comments_url":"https://api.github.com/repos/odoo/odoo/issues/14092/comments","events_url":"https://api.github.com/repos/odoo/odoo/issues/14092/events","html_url":"https://github.com/odoo/odoo/issues/14092","id":186580562,"number":14092,"title":"TypeError(repr(o) + “ is not JSON serializable”) - Odoo v8","user":{"login":"kkoci","id":3047897,"avatar_url":"https://avatars.githubusercontent.com/u/3047897?v=3","gravatar_id":"","url":"https://api.github.com/users/kkoci","html_url":"https://github.com/kkoci","followers_url":"https://api.github.com/users/kkoci/followers","following_url":"https://api.github.com/users/kkoci/following{/other_user}","gists_url":"https://api.github.com/users/kkoci/gists{/gist_id}","starred_url":"https://api.github.com/users/kkoci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkoci/subscriptions","organizations_url":"https://api.github.com/users/kkoci/orgs","repos_url":"https://api.github.com/users/kkoci/repos","events_url":"https://api.github.com/users/kkoci/events{/privacy}","received_events_url":"https://api.github.com/users/kkoci/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-01T16:32:59Z","updated_at":"2016-11-02T03:00:48Z","closed_at":"2016-11-02T03:00:48Z","body":"Impacted versions: 8\r\n\r\nSteps to reproduce:\r\n\r\nI have this method, which calls for a withholding document associated with an invoice on Odoo v8.\r\n\r\n> @api.multi\r\ndef button_generate_wh_doc(self):\r\n    context = self._context\r\n    partner = self.env['res.partner']\r\n    res = {}\r\n    for inv in self:\r\n        view_id = self.env['ir.ui.view'].search([\r\n            ('name', '=', 'account.invoice.wh.iva.customer')])\r\n        context = self.env.context.copy()\r\n        context.update({\r\n            'domain':[\r\n                ('invoice_id','=',inv.id),\r\n                ('type','=',inv.type),\r\n                ('default_partner_id','=', partner._find_accounting_partner(inv.partner_id).id),\r\n                ('default_name' ,'=', inv.name or inv.number),\r\n                ('view_id' ,'=', view_id)\r\n            ]\r\n        })\r\n    return {\r\n        'name': _('Withholding vat customer'),\r\n        'type': 'ir.actions.act_window',\r\n        'res_model': 'account.wh.iva',\r\n        'view_type': 'form',\r\n        'view_id': False,\r\n        'view_mode': 'form',\r\n        'target': 'current',\r\n        'domain': [('type', '=', inv.type )],\r\n        'context': context,\r\n    }\r\n\r\n\r\nCurrent behavior: Everytime I try this from button it throws this:\r\n\r\n> Traceback (most recent call last):\r\nFile \"/home/kristian/odoov8/odoo-8.0-20161017/openerp/http.py\", line 544, in _handle_exception\r\nreturn super(JsonRequest, self)._handle_exception(exception)\r\nFile \"/home/kristian/odoov8/odoo-8.0-20161017/openerp/http.py\", line 595, in dispatch\r\nreturn self._json_response(result)\r\nFile \"/home/kristian/odoov8/odoo-8.0-20161017/openerp/http.py\", line 533, in _json_response\r\nbody = simplejson.dumps(response)\r\nFile \"/usr/local/lib/python2.7/dist-packages/simplejson/__init__.py\", line 366, in dumps\r\nreturn _default_encoder.encode(obj)\r\nFile \"/usr/local/lib/python2.7/dist-packages/simplejson/encoder.py\", line 269, in encode\r\nchunks = self.iterencode(o, _one_shot=True)\r\nFile \"/usr/local/lib/python2.7/dist-packages/simplejson/encoder.py\", line 348, in iterencode\r\nreturn _iterencode(o, 0)\r\nFile \"/usr/local/lib/python2.7/dist-packages/simplejson/encoder.py\", line 246, in default\r\nraise TypeError(repr(o) + \" is not JSON serializable\")\r\n\r\nExpected behavior:\r\nIt should create a withholding document associated with the invoice where I'm calling it.\r\nVideo/Screenshot link (optional):\r\n\r\nAlready asked this on Stack Overflow, and a user pointed that this has to be a bug:\r\nhttp://stackoverflow.com/questions/40347743/typeerrorrepro-is-not-json-serializable-odoo-v8/40364060#40364060\r\n\r\n\r\n"}}
{"actor":{"display_login":"kkoci"}}