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
[REF] stock,mrp: autoconfirm on move instead of picking #106910
base: master
Are you sure you want to change the base?
Conversation
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.
Auto-confirm part looks good to me. Deleting non-draft moves will probably need some tests added/modified to make sure we cover the additional potential flows it will add.
b215b9d
to
8bf8ded
Compare
Currently there is an issue with the kit. If you create an immediate transfer with a kit, it will have a correct behavior and split it in different moves. However in the code it's not optimal. It will split the move during the inverse of the field `quantity_done` It means that during the create when you get the move back with `moves = super().create(vals)` it will return an id of a move that doens't exists anymore and we can't get easily the new moves created from the `action_explode` This commit removes the autoconfirm on the picking level. Instead autoconfirm during the create of the move (the purpose is to return the new sets of moves if an extra processing is required). It continues to confirm on the picking afterward to trigger the scheduler. It allows to confirm `stock.picking` with a state different than draft and cancel. It's to be able to remove easier the initial move of the kit. We could made a patch to prevent the reservation and let it draft but the feature of being able to delete every move except done ones is a good idea.
8bf8ded
to
704e0ae
Compare
It's not possible to unlink a move in draft or done state. You can't cancel a single move neither. The workaround for it, would be to set the quantity done to zero or not process the backorder. It would be easier for the user to simply unlink the unwanted move. It could be risky in a case with chained moves. But the process already exist in `_action_cancel` or when a backorder is not process. So we could reuse it in this case. Also fix a bug when the move dest state are not recompute after a cancel. Add a way to cancel the picking when it's empty.
704e0ae
to
519ac8d
Compare
Since the confirmation is on the move now we could also remove the code from `mrp.production` to keep it simple.
83e0d39
to
8b2ba2c
Compare
robodoo r+ rebase-ff |
Merge method set to rebase and fast-forward. |
Currently there is an issue with the kit. If you create an immediate transfer with a kit, it will have a correct behavior and split it in different moves. However in the code it's not optimal. It will split the move during the inverse of the field `quantity_done` It means that during the create when you get the move back with `moves = super().create(vals)` it will return an id of a move that doens't exists anymore and we can't get easily the new moves created from the `action_explode` This commit removes the autoconfirm on the picking level. Instead autoconfirm during the create of the move (the purpose is to return the new sets of moves if an extra processing is required). It continues to confirm on the picking afterward to trigger the scheduler. It allows to confirm `stock.picking` with a state different than draft and cancel. It's to be able to remove easier the initial move of the kit. We could made a patch to prevent the reservation and let it draft but the feature of being able to delete every move except done ones is a good idea. Part-of: #106910
It's not possible to unlink a move in draft or done state. You can't cancel a single move neither. The workaround for it, would be to set the quantity done to zero or not process the backorder. It would be easier for the user to simply unlink the unwanted move. It could be risky in a case with chained moves. But the process already exist in `_action_cancel` or when a backorder is not process. So we could reuse it in this case. Also fix a bug when the move dest state are not recompute after a cancel. Add a way to cancel the picking when it's empty. Part-of: #106910
Since the confirmation is on the move now we could also remove the code from `mrp.production` to keep it simple. closes #106910 Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
@amoyaux staging failed: ci/runbot on 7eaadbec754c422650d1cf02196c744fced9f3ae (view more at https://runbot.odoo.com/runbot/build/22234513) |
@amoyaux This one is shown as failed PR on the mergebot dashboard, could you have a look |
@rdeodoo I know it's just not a priority |
@robodoo r- I see, let's remove it from the dashboard then. |
Currently there is an issue with the kit. If you create an immediate transfer with a kit, it will have a correct behavior and split it in different moves. However in the code it's not optimal.
It will split the move during the inverse of the field
quantity_done
It means that during the create when you get the move back withmoves = super().create(vals)
it will return an id of a move that doens't exists anymore and we can't get easily the new moves created from theaction_explode
This commit removes the autoconfirm on the picking level. Instead autoconfirm during the create of the move (the purpose is to return the new sets of moves if an extra processing is required). It continues to confirm on the picking afterward to trigger the scheduler.
It allows to confirm
stock.picking
with a state different than draft and cancel. It's to be able to remove easier the initial move of the kit. We could made a patch to prevent the reservation and let it draft but the feature of being able to delete every move except done ones is a good idea.Description of the issue/feature this PR addresses:
Current behavior before PR:
Desired behavior after PR is merged:
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr