I can't make a field(selection type) disappear from the form tryton when i check an other field(boolean type)

Hi people , i have two fields one is “boolean type” the other field is “selection type” , i want when i check the fieldA (boolean type) ,the fieldB should be disappear from the form .

this is the fieldA :
fieldA = fields.Boolean('the field A', domain=[("fieldB","=",True)])
this is the fieldB :
fieldB = fields.Selection('on_change_position','a-Position (mm)', readonly = False,)

Although i made the domain to make the field should be deleted when i check the other , but nothing happen ,so i want to know is there something like i said now,can be done on tryton ,thanks in advance.

I guess you can use states on fieldB:

fieldB = fields.Selection('on_chan`…, states = {‘invisible’: Bool(Eval(‘fieldA’))} )

1 Like

domain is only to constrain the value of the field.
It is the states that can manage the visibility.

1 Like

yeah thank you , and about the name_report.fodt ,if once I would like to print it on my PDF and another time I wouldn’t to print it ,How i should define this field !

I do not understand the question related to the topic. Why are you talking about print and report? This seems off-topic.

yeah i want to know the same thing how to define this field once invisible and once not ,if i want to define it on my pdf

You do not define fields in report. Fields are only on Model.

1 Like

yeah , thank you i know ,Me i just want to know if there is a way to call this field(once appear and once not) on the same PDF ,and let it visible or not depends on my choice of another field.

yeah
Me i was called the fieldB like that on report_name.fodt

So i want this fieldB be visible or invisible on my PDF , depends on the boolean field that i will check .

This is completely off the topic.
There is not visible/invisible on report. You just write statement to display what you want to display.

PS: Start a new thread if you change the subject

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.