From ee7254dcd0bb611d0a98bbe83c5d7f78b09ef989 Mon Sep 17 00:00:00 2001 From: Justine Doutreloux Date: Tue, 8 Aug 2023 13:41:34 +0200 Subject: [PATCH] [IMP] stachechat_mixin: make it possible to ignore some events in the has_allowed_event compute --- statechart/models/statechart_mixin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/statechart/models/statechart_mixin.py b/statechart/models/statechart_mixin.py index 91c5bd4..b6a0344 100644 --- a/statechart/models/statechart_mixin.py +++ b/statechart/models/statechart_mixin.py @@ -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")