Skip to content

Commit

Permalink
[IMP] stachechat_mixin: make it possible to ignore some events in the…
Browse files Browse the repository at this point in the history
… has_allowed_event compute
  • Loading branch information
jdoutreloux committed Aug 8, 2023
1 parent 78c110d commit ee7254d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion statechart/models/statechart_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,10 @@ class can override the statechart with another one adding new events,

@api.model
def _get_sc_event_allowed_field_names(self):
ignore_for_has_allowed_events = self.env.context.get("ignore_for_has_allowed_events", [])
event_names = self._statechart.events_for()
return [
_sc_make_event_allowed_field_name(event_name) for event_name in event_names
_sc_make_event_allowed_field_name(event_name) for event_name in event_names if event_name not in ignore_for_has_allowed_events
]

@api.depends("sc_state")
Expand Down

0 comments on commit ee7254d

Please sign in to comment.