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

[18.0][MIG] stock_helper #2223

Open
wants to merge 32 commits into
base: 18.0
Choose a base branch
from

Conversation

JasminSForgeFlow
Copy link
Contributor

Standard Migration

@ForgeFlow

guewen and others added 30 commits December 17, 2024 09:59
The first method is: StockLocation.is_sublocation_of()

This method is currently used in:

* wms/stock_dynamic_routing
* wms/shopfloor
* wms/stock_move_source_relocate
* stock-logistics-warehouse/stock_reserve_rule
* ddmrp/ddmrp

The goal will be to use this module as dependency instead of
reimplementing the method in each.

Other methods should follow in "stock_helper".

Note: I opened odoo/odoo#53866 to propose a
generic version of this method, expecting odoo's opinion, but got no
answer.
Currently translated at 100.0% (1 of 1 strings)

Translation: stock-logistics-warehouse-16.0/stock-logistics-warehouse-16.0-stock_helper
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-16-0/stock-logistics-warehouse-16-0-stock_helper/hr/
returns the next source location of a location by the given route and procure_method
Currently translated at 100.0% (1 of 1 strings)

Translation: stock-logistics-warehouse-16.0/stock-logistics-warehouse-16.0-stock_helper
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-16-0/stock-logistics-warehouse-16-0-stock_helper/it/
Since this change in v17
odoo/odoo@439ca89
_get_rule fallbacks to location's warehouse to check for routes.
This makes that the receipt route is found by _get_source_location_from_route.
However, this is the case only with `stock` module installed, because
as soon as `mrp` or `purchase` is installed that first step of the receipt
route get removed in favor of manufacture or purchase routes. See
odoo/odoo@d25d320
Copy link
Contributor

@jbaudoux jbaudoux left a comment

Choose a reason for hiding this comment

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

Thanks for the migration.

However such a module name should not continue to exist, it means nothing.

Can we rename to stock_location_is_sublocation ?
And move the route source location method to another module ?

You are missing commit 2fb24c5

)
return res

def _get_source_location_from_route(self, route, procure_method):
Copy link
Contributor

Choose a reason for hiding this comment

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

I find it strange to have that on stock.location and not on stock.route. We are asking the route to return a source location given an end location.
I would have moved that to a module like stock_route_location_source

Copy link
Contributor

Choose a reason for hiding this comment

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

@jbaudoux
Copy link
Contributor

/ocabot migration stock_helper

@OCA-git-bot OCA-git-bot added this to the 18.0 milestone Dec 31, 2024
@OCA-git-bot OCA-git-bot mentioned this pull request Dec 31, 2024
23 tasks
@mt-software-de
Copy link
Contributor

Thanks for the migration.

However such a module name should not continue to exist, it means nothing.

Can we rename to stock_location_is_sublocation ? And move the route source location method to another module ?

You are missing commit 2fb24c5

Yes i agree on that, there should be a dedicated addon per function. I should have done this when I outsourced the method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.