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

[15.0][MIG] stock_orderpoint_generator: Migration to 15.0 #1627

Merged
merged 15 commits into from
Apr 14, 2023

Conversation

chienandalu
Copy link
Member

@chienandalu chienandalu commented Feb 1, 2023

TT36996 cc @Tecnativa

Cyril Gaudin and others added 14 commits February 1, 2023 15:47
…#258)

And improve the wording

* Add an option to automatically generate rules

When a product variant is created with a (or several) rule template(s), it
automatically generates (on the fly) the corresponding rule(s). When a rule template
is modified, it automatically updates the existing rules of the linked
products (it uses the mechanism in place, disable the old and create a
fresh one). The latter update is done by a cron because it might take a
long time to update all the products reordering rules.

* Add documentation

* Copy orderpoint views to orderpoint templates

Unfortunately we cannot rely on the possibility to copy a view with
"inherit_id" + "mode=primary" in Odoo 9.0 in this use case (precisely
with a model that is a "copy by prototype").

The explanation:

We "copy by prototype" the model "stock.warehouse.orderpoint" to a new
"stock.warehouse.orderpoint.template" model (with both _inherit and
different _name). Before this commit, we were reusing the
stock.warehouse.orderpoint's views, just making the changes needed for
the templates. Thing is: when a third (unrelated) addon adds a column on
the model, the ORM doesn't add the column in the
stock.warehouse.orderpoint.template model. So the templates' views
complains about this unexisting field.

Therefore, copy-pasting the view ensure that changes on
'stock.warehouse.orderpoint' does not have any side effect on the
templates.

From Odoo 10.0, the "copy by prototype" reports the changes made on the
"prototype" model to the "copy" so we should be able to revert to the
"inherit_id" + "mode=primary" views.
Currently translated at 50.7% (38 of 75 strings)

Translation: stock-logistics-warehouse-12.0/stock-logistics-warehouse-12.0-stock_orderpoint_generator
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_orderpoint_generator/sl/
With initial wrong values we can carry a computing error to the
subsequent moves.
A new option for auto computing minimum and maximum values depending on
the actual delivered items for a period of time
@chienandalu chienandalu force-pushed the 15.0-mig-stock_orderpoint_generator branch 2 times, most recently from a2b86f4 to d9bb573 Compare February 1, 2023 16:04
@chienandalu chienandalu force-pushed the 15.0-mig-stock_orderpoint_generator branch from d9bb573 to 38ed109 Compare March 14, 2023 17:40
@rousseldenis
Copy link
Contributor

@chienandalu Still draft ?

@chienandalu chienandalu marked this pull request as ready for review March 16, 2023 14:53
@chienandalu
Copy link
Member Author

No, it's ready for review. Thanks :)

@chienandalu chienandalu force-pushed the 15.0-mig-stock_orderpoint_generator branch from 38ed109 to d2d0c80 Compare March 16, 2023 16:05
@rousseldenis
Copy link
Contributor

/ocabot migration stock_orderpoint_generator

@chienandalu chienandalu force-pushed the 15.0-mig-stock_orderpoint_generator branch from d2d0c80 to 313e197 Compare March 21, 2023 11:44
@chienandalu
Copy link
Member Author

All fixed @rousseldenis

("location_id", "=", self.location_id.id),
("company_id", "=", self.company_id.id),
]
).unlink()
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a change in the module behavior. @yvaucher

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, there's a unique key constraint for product, location_id, company_id that won't let us simply archive them. So we can only delete the old ones.

Copy link
Contributor

@rousseldenis rousseldenis left a comment

Choose a reason for hiding this comment

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

Code review

@pedrobaeza pedrobaeza changed the title [MIG] stock_orderpoint_generator: Migration to 15.0 [15.0][MIG] stock_orderpoint_generator: Migration to 15.0 Apr 14, 2023
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

/ocabot merge nobump

@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). 🤖

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 15.0-ocabot-merge-pr-1627-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 072517f into OCA:15.0 Apr 14, 2023
@OCA-git-bot
Copy link
Contributor

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

@pedrobaeza pedrobaeza deleted the 15.0-mig-stock_orderpoint_generator branch April 23, 2023 09:47
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.

10 participants