-
-
Notifications
You must be signed in to change notification settings - Fork 723
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
[14.0][FIX] stock_location_package_restriction for backorder #1797
[14.0][FIX] stock_location_package_restriction for backorder #1797
Conversation
@@ -31,8 +31,9 @@ def _check_location_package_restriction(self): | |||
location_packages = { | |||
g["location_id"][0]: set(g["package_id"]) for g in quants_grouped | |||
} | |||
lines_being_processed = self.move_line_ids.filtered(lambda line: line.qty_done) |
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.
@TDu Is this working when not using the detailed operations and quantity_done directly on stock.move ?
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.
Thanks for your review and the answer is no, it is not working...
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.
It should also work as there are always move lines. See https://github.com/odoo/odoo/blob/14.0/addons/stock/models/stock_move.py#L358
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.
My quick test was changing the unit test to update the quantity done on the stock.move instead of the move line.
And it failed with
A package is mandatory on the location BWH/Stock/TestLocation2. You cannot move the product Wood without a package
Which does not seem related to your question.
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.
LGTM
I have added options on the check function that I need from another PR. |
Only check the restriction for moves actually being done.
3047463
to
de01825
Compare
Rebased |
@rousseldenis Good for you ? |
/ocabot merge patch |
This PR looks fantastic, let's merge it! |
Congratulations, your PR was merged at 92384a0. Thanks a lot for contributing to OCA. ❤️ |
Only check the restriction for moves actually being done.