resteve
(resteve)
April 1, 2020, 7:08am
1
Current, when we like to hide a field, we do:
def _setup__(cls):
super(cls).__setup__()
cls.field_name.states['invisible'] = True
Also we need a extra task: hide the label in XML form view:
<xpath expr="/form/notebook/page[@id='xxxxx']/label[@name='field_name']" position="replace"></xpath>
IMHO when hide a field, also we need to hide the label.
pokoli
(Sergi Almacellas Abellana)
April 1, 2020, 7:54am
2
Could you elaborate why you need to hide a field in a view?
Why you dont replace the field directly with the xpath?
ced
(Cédric Krier)
April 1, 2020, 9:24am
3
The label inherit the states
from its field but only if it does not have already a states defined. This behavior is used for almost all fields that we made invisible.
resteve
(resteve)
April 1, 2020, 11:54am
4
… because you need replace all views. All tree views, all form views, …
Example:
Module “A” add “b” field.
Custom module, hide “b” field because don’t need but need other fields or features defined in module “A”.