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

When i change combobox ,the error "'int' object has no attribute 'get'"

By
lam a bao
on 11/21/13, 3:46 AM 715 views

Hi everyone .

I have field ,it is a combobox :

  <field on_change="Changesystemdoor(codemoduel)" name="codemoduel"></field>

And function when changed :

 def Changesystemdoor(self,cr,uid,codemoduel,context=None):
    process_oj=self.pool.get('product.category')
    search_oj=process_oj.search(cr, uid, [('parent_id', '=',4)])
    data_oj=process_oj.read(cr, uid, search_oj, ['id', 'name'], context)
    return {'domain':{'codeproduct':[(chil['id'], chil['name']) for chil in data_oj]}}

when I change the value of the combobox ,the error : AttributeError: 'int' object has no attribute 'get' .

can you help me ?

thanks

2
Prajul P T
On 11/21/13, 3:56 AM

Hi, The arguments you have provided for onchange is not complete. It should be:

def Changesystemdoor(self,cr,uid,ids,codemoduel,context=None):

ids is missing. And there is also another bug. The domain you are passing is not valid. It should be of the form [('field', 'operator', 'value')]. eg: [('name', '=', 'test')]

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: 11/21/13, 3:46 AM
Seen: 715 times
Last updated: 3/16/15, 8:10 AM