Stock Quant History
stock_quant_history · OCA/stock-logistics-reporting
-
Security25/25No findings
-
Activity12/25Last human commit 16 months ago
-
Required by5/250 modules depend on it
-
Maturity18/25In 3 Odoo series since 14.0
Heuristic over the facts below, not an audit · How it's computed
Migration considerations
- Raw `cr.execute()` INSERT/UPDATE/DELETE bypasses the ORM (no compute/constrains/tracking/mail): `DELETE FROM stock_quant_history where quantity = 0 and snapshot_id = %s` - re-check the table/column names still match after upgrading. migration-raw-sql-write · source
Migration review checklist, not a compatibility verdict. "Migrating to X.0" applies once you upgrade to that version; "Since X.0" means this version already ignores or rejects that code. Methodology
Description
This module allows regenerate stock.quant as it was for a given date.
All stock quant history re-generated for a given date are called snapshot.
To generate the first snapshot this module assume all stock.move.line are present in the database.
Next snapshot is computed based on the previous snapshot present in the database.
Dependencies
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 6
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
view_stock_quant_history_list |
stock.quant.history.list | stock.quant.history | list | New |
view_stock_quant_history_pivot |
stock.quant.history.pivot | stock.quant.history | pivot | New |
view_stock_quant_history_search |
stock.quant.history.search | stock.quant.history | search | New |
view_stock_quant_history_snapshot_form |
stock.quant.history.snapshot.form | stock.quant.history.snapshot | form | New |
view_stock_quant_history_snapshot_list |
stock.quant.history.snapshot.list | stock.quant.history.snapshot | list | New |
view_stock_quant_history_snapshot_search |
stock.quant.history.snapshot.search | stock.quant.history.snapshot | search | New |
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 2
-
company_idMany2onereadonly=Truerelated='location_id.company_id'store=Truestring='Company' -
inventory_dateDatetimeindex=Truerelated='snapshot_id.inventory_date'store=True -
location_idMany2one → stock.locationauto_join=Truecheck_company=Trueindex=Trueondelete='restrict'readonly=Truerequired=True args: 'stock.location', 'Location' -
lot_idMany2one → stock.lotcheck_company=Trueindex=Trueondelete='restrict'readonly=True args: 'stock.lot', 'Lot/Serial Number' -
product_idMany2one → product.productcheck_company=Trueindex=Trueondelete='restrict'readonly=Truerequired=True args: 'product.product', 'Product' -
product_tmpl_idMany2one → product.templatereadonly=Truerelated='product_id.product_tmpl_id'string='Product Template' args: 'product.template' -
product_uom_idMany2one → uom.uomreadonly=Truerelated='product_id.uom_id' args: 'uom.uom', 'Unit of Measure' -
quantityFloathelp='Quantity of products in this quant, in the default unit of measure of the product'readonly=True -
snapshot_idMany2one → stock.quant.history.snapshotcomodel_name='stock.quant.history.snapshot'help='Snapshot settings used to generate this line'index=Trueondelete='cascade'required=Truestring='Snapshot settings'
No public methods.
-
generated_dateDatetimecopy=Falsehelp='Date when stock.quant.history line have been created.'readonly=Truestring='Generated date' -
inventory_dateDatetimehelp='The date used to create stock.quant.history as it was for the given date'readonly=Truerequired=Truestring='Inventory date' -
nameCharcompute='_compute_name' -
previous_snapshot_idMany2one → stock.quant.history.snapshotcomodel_name='stock.quant.history.snapshot'help='Base snapshot used to generate this snapshot'readonly=Truestring='Snapshot base' -
stateSelectioncopy=Falsedefault='draft'readonly=Truerequired=Trueselection=[('draft', 'Draft'), ('generated', 'Generated')]string='Status' -
stock_quant_history_idsOne2many → stock.quant.historycomodel_name='stock.quant.history'help='Generated stock quant history for current snapshot settings.'inverse_name='snapshot_id'string='Stock quant history'
-
action_generate_stock_quant_history(self) -
action_related_stock_quant_history_tree_view(self)
Loading…
Loading…