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

onchange with property fields

By
mehdi
on 10/1/15, 6:30 PM 423 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

--Drees Far--
1130
| 5 2 6
Tunis, Tunisia
--Drees Far--
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.

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

1 follower(s)

Stats

Asked: 10/1/15, 6:30 PM
Seen: 423 times
Last updated: 10/2/15, 9:33 AM