Odoo Help

0

TypeError: <built-in function id> is not JSON serializable

By
supreeth
on 5/20/16, 2:20 PM 776 views

Hi all,

I have created a button and wrote function for that like, when i click on that button new pop-up form should open.

xml:

<button name="button_method" string="Test Drive Type" type="object" class="btn-primary"/>

py:

        @api.multi
def button_method(self):
view_ref = self.pool.get('ir.model.data').get_object_reference('autochip', 'so_on_form')
view_id = view_ref and view_ref[1] or False
return {
'type': 'ir.actions.act_window',
'res_model': 'test.drive.allocation',
'view_type': 'form',
'view_mode': 'form',
        'views': [(view_id, 'form')],
'view_id': view_id,
'target':'new',
}


When i click on button i am getting 

TypeError: <built-in function id> is not JSON serializable 

i am not able to find what is the issue?

what is wrong?

Can you post the entire error message?

odoo.ma by IBS Group
on 5/20/16, 5:11 PM
0
Ahmed M.Elmubarak
On 5/21/16, 2:43 AM

Hello,

Usually if the button should open a new pop-up form it'll be of type action that calls the xml action's id to open the targeted form, you can check as an example here , also if you paste your error message it'll be helpful ..


Hope this could help

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 5/20/16, 2:20 PM
Seen: 776 times
Last updated: 5/21/16, 2:43 AM