-
-
Notifications
You must be signed in to change notification settings - Fork 729
[16.0][IMP] stock_owner_restriction #1854
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
f1f757d to
3d6f6c8
Compare
ed15d3e to
a49fd85
Compare
|
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. |
a49fd85 to
d7cc954
Compare
kanda999
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.
LGTM: This update has been used in production for a year.
yostashiro
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.
Could we perhaps make the intention of adding _compute_restrict_partner_id() clearer?
79b9c2d to
5bdabf6
Compare
5bdabf6 to
dfec985
Compare
… logic to support owner restriction - Extend _update_available_quantity() and _update_reserved_quantity() in stock.quant to handle scenarios where owner_restriction should be enforced. - Create a separate _get_owner_restriction() method to improve clarity and extensibility for other modules. - Fix read_group() in stock.quant, which was incorrectly assigning the owner record instead of the owner ID in the domain. - Add compute method for restrict_partner_id to dynamically control owner assignment based on picking type restrictions. - Unlink stock.move.line records when owner_id is updated and owner_restriction is set. - Update test cases.
dfec985 to
1b873b6
Compare
| @api.depends("picking_type_id", "picking_id.owner_id", "move_dest_ids") | ||
| def _compute_restrict_partner_id(self): | ||
| for move in self: | ||
| if move.picking_type_id.owner_restriction == "picking_partner": |
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.
Please check the validity of this suggestion.
| if move.picking_type_id.owner_restriction == "picking_partner": | |
| if move.picking_type_id.owner_restriction in ("picking_partner", "partner_or_unassigned"): |
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 think this is not valid. Even if we have move lines from an unassigned owner together with move lines from an assigned owner, the move will still be assigned to the partner. Therefore, we should continue allowing False for this restriction type.
Supersede #1385.
This PR does the following:
to handle scenarios where owner_restriction should be enforced.
instead of the owner ID in the domain.
based on picking type restrictions.
@qrtl QT4207