Skip to content

Commit

Permalink
Merge pull request #43 from acsone/imp-fields-sbi
Browse files Browse the repository at this point in the history
Better declaration of sc_event_allowed dynamic fields
  • Loading branch information
sbidoul authored Dec 15, 2023
2 parents 106ee21 + effa2a9 commit 4f99978
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions statechart/models/statechart_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def _compute_sc_interpreter(self):
statechart = self._statechart
for rec in self:
_logger.debug(
"initializing interpreter for %s " "with statechart %s",
"initializing interpreter for %s with statechart %s",
rec,
statechart.name,
)
Expand Down Expand Up @@ -241,10 +241,9 @@ def _sc_make_event_allowed_field(self, model_cls, event_name):
readonly=True,
store=False,
)
field.name = field_name
_logger.debug("adding field %s to %s", field_name, model_cls)
setattr(model_cls, field_name, field)
model_cls._field_definitions.append(field)
field.__set_name__(model_cls, field_name)

@api.model
def _setup_base(self):
Expand Down

0 comments on commit 4f99978

Please sign in to comment.