-
-
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
[WMS][12.0] - stock_location_zone - alpha version #653
Conversation
f49960e
to
7c322fe
Compare
7c322fe
to
3f4f540
Compare
9848456
to
83cdfbf
Compare
83cdfbf
to
d9527d6
Compare
I'll push a commit |
* Allow copy of stock locations (was blocked by constraint on unique name) * Correct loop in _compute_name returning too early if a record had no parent with a 'location_name_format' * Rename field pick_type_id to picking_type_id for coherency * Add missing _description on stock.picking.zone * Correct location_name_format format when the record is a NewId
The new constraints prevents having 2 locations with the same name in the same zone. The SQL UNIQUE constraint was blocking the installation of some addons due to demo data creating, by default, some locations with the same name for the warehouses' locations. Alternative: we could create an INDEX UNIQUE (name, location_id) WHERE picking_zone_id IS NOT NULL But it depends if we want to check the whole tree or not.
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, functional test ok. To add the development status alpha and ready to merge
The python one was much too slow with large datasets. Here we only check one level (only when the zone is directly assigned), the previous SQL constraint was checking the locations of the same level only anyway.
* Add copyright header * Add myself as contributor of stock_location_zone * Fix lint
9972bdc
to
a6998d6
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.
Approved to add more changes later.
/ocabot merge |
Hey, thanks for contributing! Proceeding to merge this for you. |
@jgrandguillaume your merge command was aborted due to failed check(s), which you can inspect on this commit of 12.0-ocabot-merge-pr-653-by-jgrandguillaume-bump-no. After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red. |
/ocabot merge I try again as Travis was red because of unaccessibility... |
Hey, thanks for contributing! Proceeding to merge this for you. |
Congratulations, your PR was merged at c2db7d0. Thanks a lot for contributing to OCA. ❤️ |
@jbaudoux Sorry arriving late in this. Just a comment about sql constraint with WHERE. Actually, you can use _sql_constraints. See what I did there https://github.com/OCA/partner-contact/blob/10.0/partner_bank_sort_code/models/res_bank.py#L14 You can use sql clause EXCLUDE. See https://www.postgresql.org/docs/11/ddl-constraints.html#DDL-CONSTRAINTS-EXCLUSION or https://www.cybertec-postgresql.com/en/postgresql-exclude-beyond-unique/ |
@rousseldenis Thanks for the hint, anyway I took care of this in #711 where it's not needed after simplification EDIT: Was still needed and your solution works like a charm :) |
This is a first prototype of the part "Warehouse map and location attributes" RFC: https://github.com/OCA/stock-logistics-warehouse/issues/654
https://docs.google.com/document/d/1mct6bFFWJqW01wGFcjc-uQNEjyCxvh6Y9TuFdRhe-b0/edit#heading=h.49w4ly4e5y8g