Odoo Help

Welcome!

This community 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.

0

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

By
Moin
on 4/10/13, 8:03 AM 670 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.

0

Francesco OpenCode

--Francesco OpenCode--
3608
| 5 7 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.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

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