This question has been flagged
1 Reply
3945 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

Avatar
Discard
Best Answer

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/

Avatar
Discard
Author

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?

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

Author

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

Can you show me your context???