TIP: You can type at any time to perform a new search.
Hierarchical Inventory adjustments
stock_inventory_hierarchical · OCA/stock-logistics-warehouse
Security findings
Migration considerations
- Imports from the old `openerp` namespace: renamed to `odoo` since Odoo 10.0. migration-openerp-import · source
- Imports from the old `openerp.tools.translate` namespace: renamed to `odoo` since Odoo 10.0. migration-openerp-import · source
- Imports from the old `openerp` namespace: renamed to `odoo` since Odoo 10.0. migration-openerp-import · source
- Imports from the old `openerp.tools.translate` namespace: renamed to `odoo` since Odoo 10.0. migration-openerp-import · source
- Imports from the old `openerp.exceptions` namespace: renamed to `odoo` since Odoo 10.0. migration-openerp-import · source
- For a target of Odoo 10.0+: use the `__manifest__.py` manifest name instead of `__openerp__.py`. The filename alone does not establish module age or compatibility. migration-openerp-manifest · source
stock_inventory_hierarchical_form_view— For a target of Odoo 17.0+: view 'stock_inventory_hierarchical_form_view' uses `attrs=`/`states=`, which are no longer supported. Convert modifiers to direct Python boolean expressions in `invisible`/`readonly`/`required`; preserve the original AND/OR logic. migration-view-attrs-states · source- Raw `cr.execute()` INSERT/UPDATE/DELETE bypasses the ORM (no compute/constrains/tracking/mail): `-- Find all sub-inventories where the line could be dispatched WITH possible_sub_inv ( line_id, inventory_id, parent_left, best_parent_left) AS ( SELECT line.id, sub_inv.id, sub_inv.parent_left, -- "deepest" of all possible sub-inventories MAX(sub_inv.parent_left) OVER(PARTITION BY line.id) FROM stock_inventory_line AS line INNER JOIN stock_location AS line_loc ON line_loc.id = line.location_id INNER JOIN stock_inventory AS main_inv ON main_inv.id = line.inventory_id INNER JOIN stock_inventory AS sub_inv ON -- strictly more or less than main inventory -- we're only interested in better matches sub_inv.parent_left > main_inv.parent_left AND sub_inv.parent_right < main_inv.parent_right INNER JOIN stock_location AS sub_inv_loc ON -- the location of the sub-inventory... sub_inv_loc.id = sub_inv.location_id AND -- ...must contain the location of the line line_loc.parent_left >= sub_inv_loc.parent_left AND line_loc.parent_right <= sub_inv_loc.parent_right) UPDATE stock_inventory_line SET inventory_id = ( SELECT inventory_id FROM possible_sub_inv WHERE line_id = stock_inventory_line.id AND -- we only want the deepest sub-inventory parent_left = best_parent_left) WHERE id IN %s` - re-check the table/column names still match after upgrading. migration-raw-sql-write · source
Migration review checklist, not a compatibility verdict. No target version is selected: apply version-specific advice only when migrating to that version or later.
- Repository
- OCA/stock-logistics-warehouse · module folder · Try on Runboat
- Module version
- 2.0.0
- Category
- Warehouse Management
- Folder size
- 1.02 MB
- License
- AGPL-3
- Application
- No
- Auto-installable
- No
- Website
- None
- Last tracking update
- 2026-08-07 07:03:05
- Authors
- Odoo Community Association (OCA), Numérigraphe
- Maintainers
- Odoo Community Association (OCA), Numérigraphe
- Committers
- Lionel Sausin, Alexandre Fayolle, Stéphane Bidoul (ACSONE), Weblate, OCA Transbot, Lionel Sausin (Numérigraphe), OCA-git-bot, oca-travis
Code Analysis
Views touched (4)
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
stock_inventory_hierarchical_form_view |
hierarchical.inventory.form | stock.inventory | form | Inherits stock.view_inventory_form |
stock_inventory_hierarchical_tree_view |
hierarchical.inventory.tree | stock.inventory | tree | Inherits stock.view_inventory_tree |
view_inventory_subinventories_filter |
hierarchical.inventory.filter | stock.inventory | Inherits stock.view_inventory_filter | |
view_stock_generate_inventory |
Generate Inventory | stock.generate.inventory | form | New |
HTTP endpoints (0)
No HTTP endpoints found for this module.
Models touched (2)
New fields (4)
-
levelIntegerdefault=3help='Maximum number of intermediate sub-inventories between the main inventory and the smallest sub-inventory.'string='Level' -
location_idMany2one → stock.locationcomodel_name='stock.location'default=<expr>required=Truestring='Location' -
only_viewBooleandefault=Truehelp='If set, only inventory on view location can be created'string='Only view' -
prefix_inv_nameCharhelp='Optional prefix for all created inventory'string='Inventory prefix'
-
generate_inventory(self)@api.multiGenerate inventory and sub-inventories for specified location/level
New fields (6)
-
complete_nameCharcompute='_complete_name'string='Complete reference' -
inventory_idsOne2many → stock.inventorycomodel_name='stock.inventory'inverse_name='parent_id'readonly=Truestates={'draft': [('readonly', False)]}string='List of Sub-inventories' -
parent_idMany2one → stock.inventorycomodel_name='stock.inventory'ondelete='cascade'readonly=Truestates={'draft': [('readonly', False)]}string='Parent Inventory' -
parent_leftIntegerindex=True args: 'Parent Left' -
parent_rightIntegerindex=True args: 'Parent Right' -
progress_rateFloatcompute='_progress_rate'string='Progress'
-
action_cancel_inventory(self)@api.multiCancel all children inventories -
name_get(self)@api.multiShow the parent inventory's name in the name of the children :param dict context: the ``inventory_display`` key can be used to select the short version of the inventory name (without the direct parent), when set to ``'short'``. The default is the long version. -
prepare_inventory(self)@api.multiPrepare inventory and all the children The standard method for this is not modular, and directly records all the inventory lines. We cannot afford to waste the computation time needed to insert these lines (it can take tens of minutes on very large warehouses), just to ignore or delete them for the mere reason that they should be in sub-inventories. So instead, we'll prepare all the sub-inventories at the same time.
Loading…