Skip to content

Commit

Permalink
[IMP] stock_release_channel: Manage release channel lifecycle
Browse files Browse the repository at this point in the history
The availability of a release channel depends on its state. A release channel
can be in one of the following states:

  - Open: the channel is available and can be used to release transfers. New
    transfer are assigned automatically to this channel.
  - Locked: the channel is available but the release of transfers from the channel
    is no more possible. New transfers are still automatically assigned to this
  - Asleep: the channel is not available and cannot be used to release
    transfers. It is also no more possible to assign transfers to this channel.

New release channels are by default "Open". You can change its state by using
the "Lock" and "Sleep" buttons. When the "Sleep" button is used, in addition to
the state change, not completed transfers assigned to the channel are unassigned
from the channel. When the "Lock" button is used, only the state change is changed.
A locked channel can be unlocked by using the "Unlock" button.
A asleep channel can be waken up by using the "Wake up" button. When the "Wake up"
button is used, in addition to the state change, the system looks for pending
transfers requiring a release and try to assign them to a channel in the
"Open" or "Locked" state.
  • Loading branch information
lmignon authored and rousseldenis committed May 2, 2023
1 parent b8380f9 commit 1fa7123
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion stock_release_channel/models/stock_release_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,9 @@ def _prepare_domain(self):
domain = safe_eval(self.rule_domain) or []
return domain

@api.model
def _get_assignable_release_channel_domain(self):
return []
return [("state", "!=", "asleep")]

@api.model
def assign_release_channel(self, picking):
Expand Down

0 comments on commit 1fa7123

Please sign in to comment.