Skip to content

[18.0][MIG] stock_orderpoint_generator: Migration to 18.0 - #72

Open
clementmbr wants to merge 25 commits into
OCA:18.0from
akretion:18-mig-stock_orderpoint_generator
Open

[18.0][MIG] stock_orderpoint_generator: Migration to 18.0#72
clementmbr wants to merge 25 commits into
OCA:18.0from
akretion:18-mig-stock_orderpoint_generator

Conversation

@clementmbr

Copy link
Copy Markdown
Member
  • basic migration
  • improve how to make stock.move in tests
  • adapt tests to new constrains on product_min_qty < product_max_qty
  • little fix on auto_same_values check

Cyril Gaudin and others added 23 commits February 10, 2026 19:02
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.
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
The Size attribute is already defined in the point_of_sale module so
when both modules are installed an error occurs in the tests. This is
solved by changing the name of the attribute in the tests of the
stock_orderpoint_generator module.

TT41548
Currently translated at 100.0% (90 of 90 strings)

Translation: stock-logistics-orderpoint-17.0/stock-logistics-orderpoint-17.0-stock_orderpoint_generator
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-orderpoint-17-0/stock-logistics-orderpoint-17-0-stock_orderpoint_generator/it/

@metaminux metaminux left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Everything is functionally right, even the new reconciliation logic against min/max constraint

Only 2 recommendations from OCA migration guidelines (see my comments inline)

There is also a typo (missing "r" in module's name) in the "first" migration commit message, it should be named :

[MIG] stock_orderpoint_generator: Basic Migration to 18.0

instead of :

[MIG] stock_oderpoint_generator: Basic Migration to 18.0

So nothing totally blocking, but those changes would be appreciated

Regards,

Comment thread stock_orderpoint_generator/views/orderpoint_template_views.xml Outdated
Comment thread stock_orderpoint_generator/tests/test_orderpoint_generator.py
@metaminux metaminux mentioned this pull request May 15, 2026
8 tasks
@metaminux

Copy link
Copy Markdown

Hello @clementmbr

Do you need some help on this one ?

@clementmbr
clementmbr force-pushed the 18-mig-stock_orderpoint_generator branch from 9c38119 to 2427f06 Compare July 24, 2026 11:07
@OCA-git-bot OCA-git-bot added series:18.0 mod:stock_orderpoint_generator Module stock_orderpoint_generator labels Jul 24, 2026
@clementmbr
clementmbr force-pushed the 18-mig-stock_orderpoint_generator branch from 2427f06 to b4bfbbd Compare July 24, 2026 11:09
@clementmbr
clementmbr requested a review from metaminux July 24, 2026 11:10
@clementmbr

Copy link
Copy Markdown
Member Author

Hi @metaminux ! Thanks for your assertive feedback 🙏
I think I fixed everything you listed, hope it's ok now!

@rousseldenis

Copy link
Copy Markdown
Contributor

/ocabot migration stock_orderpoint_generator

@OCA-git-bot OCA-git-bot added this to the 18.0 milestone Jul 27, 2026
@rousseldenis

Copy link
Copy Markdown
Contributor

@clementmbr Thanks for this.

Could you put version change in migration commit and make module name appear in last commit? Thanks

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:stock_orderpoint_generator Module stock_orderpoint_generator series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.