-
-
Notifications
You must be signed in to change notification settings - Fork 209
[IMP] stock_release_channel: Allow to sleep and reassign pickings #1011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 16.0
Are you sure you want to change the base?
Conversation
|
Hi @sebalix, @mt-software-de, @jbaudoux, |
23b31b4 to
dfb9b5d
Compare
mt-software-de
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx. This sounds great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about only keeping the sleep action and show a confirmation wizard if there are started or done pickings ? Something similar to https://github.com/OCA/wms/blob/16.0/stock_release_channel_shipment_advice_deliver/models/stock_release_channel.py#L187
You can highlight discard button in the wizard and have a sleep & reassign button calling that safe sleep
| ) | ||
| pickings_to_unassign.write({"release_channel_id": False}) | ||
| pickings_to_unassign.unrelease() | ||
| pickings_to_unassign.unrelease(safe_unrelease=safe_sleep) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to fix conflict with #1009
If you enable to return done pickings on the route, then it will not reassign as generating a return is now considered as a safe unrelease.
Should we add another argument to prevent any return ?
In some cases, we don't want to use an open channel to deliver pickings anymore. But the internal transfers may have been done. In that case, we should not unrelease done pickings but just removing the channel and triggering an assignation (to put those transfers in another open channel).
dfb9b5d to
3018642
Compare
| def _compute_is_action_safe_sleep_allowed(self): | ||
| for rec in self: | ||
| rec.is_action_safe_sleep_allowed = bool( | ||
| rec.state in ["locked", "open"] and rec.open_picking_ids |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think checking open_picking_ids is useful
| def action_sleep(self): | ||
| self._sleep() | ||
|
|
||
| def action_safe_sleep(self): | ||
| self._sleep(safe=True) | ||
| return {"type": "ir.actions.act_window_close"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not add a second button but manage it in existing action_sleep.
Test if there are done internal transfer.
If True, raise a wizard popup showing them and asking to confirm the reassignment of those to another channel. on confirm, call self._sleep(safe=True).
Else call self._sleep()
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
In some cases, we don't want to use an open channel to deliver pickings anymore. But the internal transfers may have been done.
In that case, we should not unrelease done pickings but just removing the channel and triggering an assignation (to put those transfers in another open channel).