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

On_change function will Do Things what i want?

By
vadivel
on 6/26/14, 6:29 AM 350 views

Hi All Can we have solution to do a field as mandatory through on_change?Please do reply as soon as Possible......

2

Bole

--Bole--
2385
| 5 4 6
Zagreb | Karlovac, Croatia
--Bole--

there is only 10 kind of people the ones that understand binary ... and others

Bole
On 6/27/14, 2:52 AM

If i got your point right.. you want conditional requred fields... 
For example when some field changes depending on value of that field other field is required, or hidden ... or something.. 
Yes, you can do that, trough view definition (example);

<field name="some_bool">
<field name="some_selection">
<field name="some_value" attrs="{'invisible':[('some_bool','=',True)], 'required':[('some_selection','=','some_sel_value)]} />

In this example view def you have conditional visibility, and conditional required field... no on_change needed 
and if needed complex required check... you can write some method that returns True or False and call it instead of putting [()] conditions in brackets...

Hope this helps.. 

 

Thank for your Reply Friend It helped me lot Thank you So much

vadivel
on 6/27/14, 6:54 AM

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: 6/26/14, 6:29 AM
Seen: 350 times
Last updated: 3/16/15, 8:10 AM