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

can i change field's attr in view from on_change?

By
voathnak lim
on 9/23/13, 1:46 AM 1,332 views

Hello, I have a requirement to change the property required and visible depend on comparing the value that user have just enter with the value from database. so can i change the required=True to False from on_change function? Thanks

0
DNTQ
On 9/23/13, 2:35 AM

Onchange in OpenERP on_change in OpenERP has 3 possible values returned finally in a dictionary or a {} .

1: The value dictionary i.e {field1:value1,field2:value2}

2: The domain dictionary i.e {field1:domain1}

3: The warning please check answer of Mr. Naresh Soni http://help.openerp.com/question/13900/how-to-return-a-domain-on-field-on-onchange-action/

Hello DNT, what i want is to hide the field or make the field require. but why you show me the domain. is using domain can hide the field?

voathnak lim
on 9/23/13, 5:09 AM

You can using atrrs="{required:[(your condition)]"

DNTQ
on 9/23/13, 6:28 AM

Thank you DNT, but how can i set it from on_change function?

voathnak lim
on 9/23/13, 1:34 PM

Can you show me your context???

DNTQ
on 9/24/13, 4:27 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

0 follower(s)

Stats

Asked: 9/23/13, 1:46 AM
Seen: 1332 times
Last updated: 3/16/15, 8:10 AM