Skip to content
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

[MIG][13.0] stock_location_zone migration #804

Merged
merged 11 commits into from
Mar 23, 2020

Conversation

guewen
Copy link
Member

@guewen guewen commented Dec 19, 2019

Migration of stock_location_zone, including #711

@ps-tubtim
Copy link
Member

@guewen Code LGTM. Could you create tests of this module?

jbaudoux and others added 11 commits March 17, 2020 11:06
* 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
* Add copyright header
* Add myself as contributor of stock_location_zone
* Fix lint
It prevents other addons to work properly such as the vertical lift.
We remove the constraint for now, maybe to be re-introduced later in a
more permissive way.
* Compute the 'zone' fields in the same method
* Remove the dependency on 'zone_location_id', which seems to take
  a lot of time if not an infinite loop
So we can use it in group-by and filters. Note that we can have several
levels of areas... only the top-level will be used.

This commit fixes the computed field dependencies:
_compute_location_kind should have a dependency on both it's parent's
location_kind and on its child_ids to know if we are in a bin. This
can't work without triggering an infinite loop. The trick used here is
to split the computation of 'zone_location_id + area_location_id' in one
computed method, and move the computation of the kind in a different
method with triggers an the current record's zone_location +
area_location_id, but not on the parent.

Plus the zone_location_id and area_location_id do not depend anymore on
the parent's kind, which is the reason for the infinite loop.
@guewen guewen force-pushed the 13.0-mig-stock_location_zone branch from e115b43 to 9cf7fd4 Compare March 17, 2020 10:08
@simahawk
Copy link
Contributor

@guewen do you want to merge 12.0 first?
@grindtildeath is that one ready to be re-reviewed?

Copy link
Member

@jgrandguillaume jgrandguillaume left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, as Alpha for now it's sufficiant for now for me

Copy link
Contributor

@grindtildeath grindtildeath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great to add tests, but LG 👍

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@simahawk
Copy link
Contributor

/ocabot merge

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 13.0-ocabot-merge-pr-804-by-simahawk-bump-no, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Mar 23, 2020
Signed-off-by simahawk
@OCA-git-bot
Copy link
Contributor

It looks like something changed on 13.0 in the meantime.
Let me try again (no action is required from you).
Prepared branch 13.0-ocabot-merge-pr-804-by-simahawk-bump-no, awaiting test results.

@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 81a97d3. Thanks a lot for contributing to OCA. ❤️

@OCA-git-bot OCA-git-bot merged commit e37858d into OCA:13.0 Mar 23, 2020
CarlosRoca13 pushed a commit to Tecnativa/stock-logistics-warehouse that referenced this pull request Aug 16, 2021
Signed-off-by simahawk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants