This question has been flagged
2 Replies
5608 Views

fields.selection: A and B

   A = fields1 will show and fields2 will automatically hide.

   B = fields2 will show and fields1 will automatically hide.
 

how will i going to do this... any help please!!

 

   

 

Avatar
Discard
Best Answer

Hi

Try this

<field name="Selection_Field" />

<field name="A"  attrs="{'invisible': [('Selection_Field', '=', 'B')]}"/>

<field name="B"  attrs="{'invisible': [('Selection_Field', '=', 'A')]}"/>

 

Avatar
Discard
Author

hi sir, thanks for this info. but another problem occur how to hide the fields A and B.. the fields showed even if the user doesn't choose from the selection..

Best Answer

You can do it by adding a domain to your field and using widget selection in your xml.

Maybe, this question  https://www.odoo.com/forum/help-1/question/widget-selection-with-domain-fields-issue-12690 can help you.

Avatar
Discard