Skip to content

Commit

Permalink
stock_release_channel_shipment_advice_deliver: fix notification
Browse files Browse the repository at this point in the history
Test if the shipment advice is linked to a release channel for sending notification
  • Loading branch information
jbaudoux committed Oct 1, 2024
1 parent 2798d5e commit d4897b0
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,15 @@ def _auto_process(self):

def _postprocess_action_done(self):
res = super()._postprocess_action_done()
if not self.release_channel_id:
return res
if self.state == "error":
return self.release_channel_id._shipment_advice_auto_process_notify_error(
self.error_message
)
if self.state != "done":
return res
return self.release_channel_id._shipment_advice_auto_process_notify_success()
if self.state == "done":
return self.release_channel_id._shipment_advice_auto_process_notify_success()
return res

def action_done(self):
# If the channel is in error and we try to validate its shipment
Expand Down

0 comments on commit d4897b0

Please sign in to comment.