-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
[16.0][ADD] stock_available_to_promise_release_restrict_lot #943
base: 16.0
Are you sure you want to change the base?
[16.0][ADD] stock_available_to_promise_release_restrict_lot #943
Conversation
d757a5c
to
d564086
Compare
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.
A little comment about readability...
stock_available_to_promise_release_restrict_lot/models/stock_move.py
Outdated
Show resolved
Hide resolved
d564086
to
764f1a3
Compare
764f1a3
to
6716ca7
Compare
6716ca7
to
2d19580
Compare
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 wonder how this can work
|
||
def _previous_promised_qty_sql_lateral_where(self, warehouse): | ||
sql, params = super()._previous_promised_qty_sql_lateral_where(warehouse) | ||
sql += "AND m.restrict_lot_id is null" |
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 do this. If you place a move without restrict lot, any move before should reserve a qty no matter they are restricted to a lot or not.
Example:
Move1 for lotA
Move2 for any lot. Should consider the previous Move1 taking from stock
return AND( | ||
[ | ||
[ | ||
("restrict_lot_id", "=", self.restrict_lot_id.id), | ||
("state", "not in", ["done", "cancel"]), | ||
("id", "!=", self.id), | ||
], | ||
OR( | ||
[ | ||
[("priority", ">", self.priority)], | ||
[ | ||
("priority", "=", self.priority), | ||
("date_priority", "<", self.date_priority), | ||
], | ||
[ | ||
("priority", "=", self.priority), | ||
("date_priority", "=", self.date_priority), | ||
("id", "<", self.id), | ||
], | ||
] | ||
), | ||
] | ||
) |
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.
Seems to miss quite a few things in this domain: need_release, outgoing, picking type, locations...
When both stock_available_to_promise_release and stock_restrict_lot modules are installed, the calculation of quantities available to promise doesn't properly account for lot restrictions. This results in a priority conflict, where higher-priority moves that are restricted to a specific lot receive available quantities from any lot, bypassing their lot restriction.
This glue module enhances stock move allocation by: