We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bf74ebc commit 202ecdaCopy full SHA for 202ecda
edi_oca/models/edi_exchange_consumer_mixin.py
@@ -404,3 +404,13 @@ def _edi_send_via_email(
404
# Send the email
405
composer.send_mail()
406
return True
407
+
408
+ def write(self, vals):
409
+ # Generic event to match a state change
410
+ # TODO: this can be added to component_event for models having the state field
411
+ if "state" in vals and "state" in self._fields:
412
+ for rec in self:
413
+ rec._event(f"on_edi_{self._table}_state_change").notify(
414
+ rec, state=vals["state"]
415
+ )
416
+ return super().write(vals)
0 commit comments