Odoo Help

0

onchange with property fields

By
mehdi
on 10/1/15, 6:30 PM 648 views

I have a field of type property, which does not recognize his method "on_change" is normal or not and whether there is another soluton. 

'standard_price': fields.property(type = 'float', groups="base.group_user")

<field name="standard_price" on_change="on_change_standard_price(standard_price, list_price)"/> 

what it's your problem?

Axel Mendoza
on 10/1/15, 6:37 PM
... on_change don't work
mehdi
on 10/2/15, 4:35 AM

give us your on_change function please

Drees Far
on 10/2/15, 5:43 AM

def on_change_standard_price(self, cr, uid, ids, standard_price, list_price, context=None): return {'value' : {'fieldx' : valuex,}}

mehdi
on 10/2/15, 6:16 AM
0
Drees Far
On 10/2/15, 8:45 AM

Hello my friend:

Here is an example of an on_change function:

Python:

def on_change_declaration_id(self, cr, uid, ids, company_id, trimester, year, context=None):

res = {'value':{'declaration_ids': self.get_inputs(cr, uid, ids, company_id, trimester, year, context=context),

}

}

return res

XML:

<field name="trimester" on_change="on_change_declaration_id(company_id, trimester, year)">;

So that in your function:

def on_change_standard_price(self, cr, uid, ids, standard_price, list_price, context=None): return {'value' : {'standard_price' : valuex,}}

And check the structure of the value that you are giving to your field.

I am on your service if you need help ;)

Regards.

i know #Drees Far and is not the first time when i use onchange you can test in your system, fields.property don't accept onchange methode.

mehdi
on 10/6/15, 10:03 AM
0
mehdi
On 10/2/15, 9:33 AM

i know #Drees Far and is not the first time when i use onchange you can test in your system, fields.property don't accept onchange methode.

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: 10/1/15, 6:30 PM
Seen: 648 times
Last updated: 10/2/15, 9:33 AM