-
-
Notifications
You must be signed in to change notification settings - Fork 192
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
[13.0][MIG] stock_storage_type #12
[13.0][MIG] stock_storage_type #12
Conversation
a6c18c0
to
a2b8ccb
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.
LG, please rebase and run pre-commit
6191c84
to
8f08d1c
Compare
Rebase done. @simahawk @guewen @jgrandguillaume Here I'm wondering if we shouldn't merge stock_storage_type_putaway_strategy (#13) into this module, because stock_storage_type only defines fields that are unused and don't make any sense by themselves, i.e. without the other module to compute putaways and restrict stock moves according to storage types... |
@grindtildeath you miss server-tools dependency
|
7836c8c
to
a7d689f
Compare
df2a8cb
to
1a1053b
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.
What about extracting the location storage type in a separate module that allows to define restrictions on the location (empty, do not mix) without needing package.
This module would add the allowed storage type concept on the location storage type and manage package.
) % (pack_storage_type.name, location.name) | ||
) | ||
allowed = False | ||
package_quants = quant.package_id.mapped('quant_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.
The constrain is evaluated at quant creation. At this stage, the package's quant is not up to date.
stock.quant(148,)
(Pdb) self.package_id
stock.quant.package(111,)
(Pdb) self.package_id.quant_ids
stock.quant()
other_quants_in_location = self.search( | ||
[ | ||
('location_id', '=', location.id), | ||
('id', 'not in', package_quants.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.
We must exclude all previous quants that are not there anymore, i.e. quantity = 0
('id', 'not in', package_quants.ids) | |
('id', 'not in', package_quants.ids), | |
('quantity', '!=', 0) |
loc_storage_types = location.allowed_location_storage_type_ids | ||
if ( | ||
not quant.package_id | ||
or not pack_storage_type |
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 still evaluate the location storage type constrain like do not mix product even if the pack storage type is not defined and even if there is not package. This condition (having a package with a storage type) is only for the "lst_allowed_for_pst" check. For the other checks, we can still apply them based only the location storage type constrain
grindtildeath#5 fixes some performance issues |
[shopfloor] pack transfer refactoring
We will never do a put-away in an intermediate location, so they should never be kept as candidate locations for the put-away. Follow the change in OCA#12
19fd0cf
to
ef111b2
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.
Thanks for the fixes and perf improvements
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.
Tested & approved
…dule Define max height/max weight restriction fields Dedicated tree view to edit package/location storage type relation Rename fields to drop stock_ prefix
Add tests Fix dependency issue for pytest [IMP] pre-commit XML files Add setuptools Add module stock_storage_type_putaway_strategy [IMP] stock_storage_type_putaway_strategy: black, isort [MIG] stock_storage_type_putaway_strategy: Migration to 13.0 Compute domain on stock.package_level location_dest_id according to storage_type restrictions Allow to compute restrictions for multiple products and quants Add constraint on stock.quant according to stock_storage_type Add tests Add tests on package destination domain Add package_level actual location to allowed domain Fix constraints do not mix products/lots
Fix failing test and add loggers Improve error message on stock.quant constraint
Check waiting moves in "Not Empty" put-away constraints When an unreserved move's destination is already a bin, we assume: * the move is probably waiting on another that will be processed soon * as the destination of the move is already a bin (not Stock, ...), the good *will* arrive in this precise location and not another So we prevent new move lines to target this location. Note: as we do not know the lot yet in the move, we cannot check if we have a planned lot for the same lot in the "Do not mix same lot": ignore it.
improve perfs * in _compute_allowed_location_dest_ids handle the case of a missing pack level, and short cut * move a mapped() call out of a loop * use the stored related field state of stock.move.line instead of a dotted path in the search domain
The choice of a suitable stock location was implemented using an iteration on all candidate locations + several filters running for each. This is not efficient when we have several 1000s of locations (each check was taking 30ms -> several minutes required to compute a putaway location). This commit reimplements the algorithm by using queries to select locations matching the rules. In order to be able to compute this using the ORM, we added some technical fields which should not harm performance too much. Co-authored-by: Guewen Baconnier <guewen.baconnier@camptocamp.com> Co-authored-by: Akim Juillerat <akim.juillerat@camptocamp.com>
edcb05a
to
96e0df5
Compare
I squashed all the commits with a group by authors. Hope this is fine for everyone involved |
Not such a big deal, but a commit message that contains 'do X AND Y', pretty often means you should have 2 separate changes. Ref good to keep in mind: https://blog.mocoso.co.uk/talks/2015/01/12/telling-stories-through-your-commits/ Anyway, the test should be fixed by my last fixup, I'll squash it if the tests pass. |
6da22cd
to
ab7042a
Compare
We will never do a put-away in an intermediate location, so they should never be kept as candidate locations for the put-away.
Which is much smaller with thousands of locations for a couple of storage types. I recycled the field location_ids on the location storage type which was a unused field (probably forgotten during a refactoring).
When we select a package in a package level, we want to restrict the selection of the location destination based on the put-away rules. The previous implementation used a computed M2m field, added in the view as an invisible field, and a domain on the location_dest_id field filtering the locations based on this m2m. The issue: with 5000 allowed locations, changing the package triggers an onchange (that we want), and the server answers with 5000 ids, which must be processed by the M2m field client side. It blocks the browser for several seconds. The module web_domain_field [0] allow to use a domain stored in a Char field rather than a field in the XML (read the module's description if not clear). Using it solves this issue, as the client doesn't need to evaluate and update a m2m field, it only pass the domain downstream. [0] https://github.com/OCA/web/tree/13.0/web_domain_field
Required by stock_storage_type
It may be a valid use case, for instance to be able to send the good on the "zone" above the bins (with a following new move to go from the Zone to the bin).
ab7042a
to
4cb1cab
Compare
/ocabot merge patch |
Hey, thanks for contributing! Proceeding to merge this for you. |
Congratulations, your PR was merged at 3691279. Thanks a lot for contributing to OCA. ❤️ |
We will never do a put-away in an intermediate location, so they should never be kept as candidate locations for the put-away. Follow the change in OCA#12
We will never do a put-away in an intermediate location, so they should never be kept as candidate locations for the put-away. Follow the change in OCA#12
We will never do a put-away in an intermediate location, so they should never be kept as candidate locations for the put-away. Follow the change in OCA#12
We will never do a put-away in an intermediate location, so they should never be kept as candidate locations for the put-away. Follow the change in OCA#12
We will never do a put-away in an intermediate location, so they should never be kept as candidate locations for the put-away. Follow the change in OCA#12
We will never do a put-away in an intermediate location, so they should never be kept as candidate locations for the put-away. Follow the change in OCA#12
Depends on:
Includes: