support auto_freeze with hidden_if_in

This commit is contained in:
2021-01-06 22:33:55 +01:00
parent 1a77416e6d
commit d5ed39c1f3
10 changed files with 61 additions and 8 deletions

View File

@ -452,19 +452,15 @@ class ConstrainteAnnotator:
main_action = actions[0]
if getattr(leader_or_variable, main_action, False) is True:
continue
if isinstance(leader_or_variable, self.objectspace.variable) and \
(leader_or_variable.auto_save or leader_or_variable.auto_freeze) and \
'force_default_on_freeze' in actions:
xmlfiles = self.objectspace.display_xmlfiles(leader_or_variable.xmlfiles)
msg = _(f'cannot have auto_freeze or auto_store with the hidden_if_in or '
f'hidden_if_not_in variable "{leader_or_variable.name}" '
f'in {xmlfiles}')
raise DictConsistencyError(msg, 51)
self.build_property(leader_or_variable,
text,
condition,
main_action,
)
if isinstance(leader_or_variable, self.objectspace.variable) and \
(leader_or_variable.auto_save or leader_or_variable.auto_freeze) and \
'force_default_on_freeze' in actions:
continue
for action in actions[1:]:
# other actions are set to the variable or children of family
for variable in variables: