Commit Graph

2 Commits

Author SHA1 Message Date
Michael Tietz
c063696d1d stock_helper: add location.get_closest_warehouse
On a multi warehouse configuration
where a warehouse view_location is parent of an other warehouse's view_location
this will return the closest warehouse of a location

Not like the get_warehouse method (odoo core code)
which returns from all parent warehouses found
the first one ordered by the sequence
2022-09-12 15:57:23 +02:00
Guewen Baconnier
f04c497a9e Add stock_helper: share common code used by stock modules
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 https://github.com/odoo/odoo/pull/53866 to propose a
generic version of this method, expecting odoo's opinion, but got no
answer.
2021-03-19 12:51:27 +01:00