Odoo Help


Is it possible to pass list or dict in on_change function from xml?

on 4/10/13, 8:03 AM 1,118 views

I ofcourse tried to pass a dict as follows with no luck:

<field name="continent_id" on_change="onchange_continent({'item1':1, 'item2':2}, continent_id)"/>

.py file:

def onchange_continent(self, cr, uid, id, testDict, continent_id=None, context=None):
    print testDict

but this throws an error:

Error: Could not get field with name '{'item1':1' for onchange 'onchange_continent({'item1':1, 'item2':2}, continent_id)'

where is the code for parsing the on_change function, maybe I can edit that for our module?

Thank You.


Francesco OpenCode

--Francesco OpenCode--

| 6 8 9
Grottaglie, Italy
--Francesco OpenCode--

Italian Odoo (OpenERP) Modules Developer LINKEDIN: http://www.linkedin.com/in/francescoapruzzese

Francesco OpenCode
On 4/10/13, 8:12 AM

No, you can't do this.

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.


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

0 follower(s)


Asked: 4/10/13, 8:03 AM
Seen: 1118 times
Last updated: 3/16/15, 8:10 AM