{"action":"opened","issue":{"url":"https://api.github.com/repos/odoo/odoo/issues/7645","labels_url":"https://api.github.com/repos/odoo/odoo/issues/7645/labels{/name}","comments_url":"https://api.github.com/repos/odoo/odoo/issues/7645/comments","events_url":"https://api.github.com/repos/odoo/odoo/issues/7645/events","html_url":"https://github.com/odoo/odoo/issues/7645","id":95441994,"number":7645,"title":"[8.0] Json serialization error on jsonRpc request","user":{"login":"yannprada","id":6585372,"avatar_url":"https://avatars.githubusercontent.com/u/6585372?v=3","gravatar_id":"","url":"https://api.github.com/users/yannprada","html_url":"https://github.com/yannprada","followers_url":"https://api.github.com/users/yannprada/followers","following_url":"https://api.github.com/users/yannprada/following{/other_user}","gists_url":"https://api.github.com/users/yannprada/gists{/gist_id}","starred_url":"https://api.github.com/users/yannprada/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yannprada/subscriptions","organizations_url":"https://api.github.com/users/yannprada/orgs","repos_url":"https://api.github.com/users/yannprada/repos","events_url":"https://api.github.com/users/yannprada/events{/privacy}","received_events_url":"https://api.github.com/users/yannprada/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-16T14:12:19Z","updated_at":"2015-07-16T14:12:19Z","closed_at":null,"body":"**Json serialization error on jsonRpc request**\r\n\r\nImpacted versions:\r\n\r\n - 8.0\r\n\r\nSteps to reproduce:\r\n\r\n 1. enable portal on admin user\r\n 2. grab a sale order\r\n 3. open browser console\r\n 4. add this code below\r\n 5. click on one payment option\r\n\r\n*code:*\r\n\r\n    $('.payment_acquirers button').on('click', function(event) {\r\n        event.preventDefault();\r\n        event.stopPropagation();\r\n        var $form = $(event.currentTarget).parents('form');\r\n        var acquirer_id = '1';\r\n        openerp.jsonRpc('/shop/payment/transaction/' + acquirer_id,  'call', {}).then(function (data) {\r\n            $form.submit();\r\n        });\r\n    })\r\n\r\nCurrent behavior:\r\n\r\n - Error raised, payment.transaction record not created, form not submited\r\n\r\n*Error:*\r\n\r\n    2015-07-16 13:53:57,507 18652 ERROR json openerp.http: Exception during JSON request handling.\r\n    Traceback (most recent call last):\r\n      File \"/home/odoo/server/openerp/http.py\", line 530, in _handle_exception\r\n        return super(JsonRequest, self)._handle_exception(exception)\r\n      File \"/home/odoo/server/openerp/http.py\", line 581, in dispatch\r\n        return self._json_response(result)\r\n      File \"/home/odoo/server/openerp/http.py\", line 519, in _json_response\r\n        body = simplejson.dumps(response)\r\n      File \"/usr/lib/python2.7/dist-packages/simplejson/__init__.py\", line 321, in dumps\r\n        return _default_encoder.encode(obj)\r\n      File \"/usr/lib/python2.7/dist-packages/simplejson/encoder.py\", line 237, in encode\r\n        chunks = self.iterencode(o, _one_shot=True)\r\n      File \"/usr/lib/python2.7/dist-packages/simplejson/encoder.py\", line 311, in iterencode\r\n        return _iterencode(o, 0)\r\n      File \"/usr/lib/python2.7/dist-packages/simplejson/encoder.py\", line 213, in default\r\n        raise TypeError(repr(o) + \" is not JSON serializable\")\r\n    TypeError: <BaseResponse 235 bytes [302 FOUND]> is not JSON serializable\r\n\r\nExpected behavior:\r\n\r\n - payment.transaction record created, form submited\r\n\r\nNote:\r\n\r\nThis is just a 'hack' to reproduce the error I have with a module I made. All the relevant code looks like the little JS script on step 4. My module is supposed to use the functionnalities already in place, and should just fix the missing bits for the modules portal_sale and payment to work together."}}