Stock Quant History

stock_quant_history
REPOSITORY
REPOSITORYOCA/stock-logistics-reporting
GIT
GIThttps://github.com/OCA/stock-logistics-reporting.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/stock-logistics-reporting/tree/17.0/stock_quant_history
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYUncategorized
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Pierre Verkest <pierreverkest84@gmail.com>
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Pierre Verkest <pierreverkest84@gmail.com>
COMMITTERS
COMMITTERSWeblate, OCA-git-bot, oca-ci
WEBSITE
WEBSITEhttps://github.com/OCA/stock-logistics-reporting
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:20:10
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - stock
    - product
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - uom
    - barcodes_gs1_nomenclature
    - barcodes
    - digest
    - portal
    - web_editor
    - http_routing
    - auth_signup
    - resource
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
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.

Code Analysis

Views touched (6)
XML IDNameModelTypeStatus
view_stock_quant_history_list stock.quant.history.list stock.quant.history tree 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 tree New
view_stock_quant_history_snapshot_search stock.quant.history.snapshot.search stock.quant.history.snapshot search New
Models touched (2)

New fields (9)
  • company_id Many2one
    readonly=True related='location_id.company_id' store=True string='Company'
  • inventory_date Datetime
    index=True related='snapshot_id.inventory_date' store=True
  • location_id Many2one → stock.location
    auto_join=True check_company=True index=True ondelete='restrict' readonly=True required=True args: 'stock.location', 'Location'
  • lot_id Many2one → stock.lot
    check_company=True index=True ondelete='restrict' readonly=True args: 'stock.lot', 'Lot/Serial Number'
  • product_id Many2one → product.product
    check_company=True index=True ondelete='restrict' readonly=True required=True args: 'product.product', 'Product'
  • product_tmpl_id Many2one → product.template
    readonly=True related='product_id.product_tmpl_id' string='Product Template' args: 'product.template'
  • product_uom_id Many2one → uom.uom
    readonly=True related='product_id.uom_id' args: 'uom.uom', 'Unit of Measure'
  • quantity Float
    help='Quantity of products in this quant, in the default unit of measure of the product' readonly=True
  • snapshot_id Many2one → stock.quant.history.snapshot
    comodel_name='stock.quant.history.snapshot' help='Snapshot settings used to generate this line' index=True ondelete='cascade' required=True string='Snapshot settings'
Public methods (0)

No public methods.

New fields (6)
  • generated_date Datetime
    copy=False help='Date when stock.quant.history line have been created.' readonly=True string='Generated date'
  • inventory_date Datetime
    help='The date used to create stock.quant.history as it was for the given date' readonly=True required=True string='Inventory date'
  • name Char
    compute='_compute_name'
  • previous_snapshot_id Many2one → stock.quant.history.snapshot
    comodel_name='stock.quant.history.snapshot' help='Base snapshot used to generate this snapshot' readonly=True string='Snapshot base'
  • state Selection
    copy=False default='draft' readonly=True required=True selection=[('draft', 'Draft'), ('generated', 'Generated')] string='Status'
  • stock_quant_history_ids One2many → stock.quant.history
    comodel_name='stock.quant.history' help='Generated stock quant history for current snapshot settings.' inverse_name='snapshot_id' string='Stock quant history'
Public methods (2)
  • action_generate_stock_quant_history(self)
  • action_related_stock_quant_history_tree_view(self)
REPOSITORY
REPOSITORYOCA/stock-logistics-reporting
GIT
GIThttps://github.com/OCA/stock-logistics-reporting.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/stock-logistics-reporting/tree/14.0/stock_quant_history
VERSION
VERSION 1.3.0
CATEGORY
CATEGORYUncategorized
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Pierre Verkest <pierreverkest84@gmail.com>, Stéphane Mangin <stephane.mangin@foodles.com>
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Pierre Verkest <pierreverkest84@gmail.com>, Stéphane Mangin <stephane.mangin@foodles.com>
COMMITTERS
COMMITTERSPierre Verkest, Weblate, OCA-git-bot, oca-ci, Stéphane Mangin
WEBSITE
WEBSITEhttps://github.com/OCA/stock-logistics-reporting
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:41:11
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - stock
    - product
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - uom
    - barcodes
    - digest
    - portal
    - web_editor
    - http_routing
    - auth_signup
    - resource
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (7)
XML IDNameModelTypeStatus
res_config_settings_view_form Stock settings: auto lock picking on snapshot creation res.config.settings div Inherits stock.res_config_settings_view_form
view_stock_quant_history_list stock.quant.history.list stock.quant.history tree 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 tree New
view_stock_quant_history_snapshot_search stock.quant.history.snapshot.search stock.quant.history.snapshot search New
Models touched (5)

New fields (1)
  • stock_history_snapshot_auto_locks_picking Boolean
    default=True groups='stock.group_stock_manager' help='When a stock quant history snapshot is generated, automatically locks all done pickings that are related to the snapshot.' string='Auto lock picking on snapshot'
Public methods (0)

No public methods.

New fields (1)
  • stock_history_snapshot_auto_locks_picking Boolean
    groups='stock.group_stock_manager' readonly=False related='company_id.stock_history_snapshot_auto_locks_picking'
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (4)
  • action_toggle_is_locked(self)
  • check_unlock_allowed(self)
    Check if the picking can be unlocked. :return: True if the picking can be unlocked :raises ValidationError: if not allowed to unlock
  • get_stock_quant_history(self)
    Get the last stock quant history related to this picking. The picking must be done. :return: stock.quant.history recordset
  • write(self, vals)

New fields (9)
  • company_id Many2one
    readonly=True related='location_id.company_id' store=True string='Company'
  • inventory_date Datetime
    index=True related='snapshot_id.inventory_date' store=True
  • location_id Many2one → stock.location
    auto_join=True check_company=True index=True ondelete='restrict' readonly=True required=True args: 'stock.location', 'Location'
  • lot_id Many2one → stock.production.lot
    check_company=True index=True ondelete='restrict' readonly=True args: 'stock.production.lot', 'Lot/Serial Number'
  • product_id Many2one → product.product
    check_company=True index=True ondelete='restrict' readonly=True required=True args: 'product.product', 'Product'
  • product_tmpl_id Many2one → product.template
    readonly=True related='product_id.product_tmpl_id' string='Product Template' args: 'product.template'
  • product_uom_id Many2one → uom.uom
    readonly=True related='product_id.uom_id' args: 'uom.uom', 'Unit of Measure'
  • quantity Float
    help='Quantity of products in this quant, in the default unit of measure of the product' readonly=True args: 'Quantity'
  • snapshot_id Many2one → stock.quant.history.snapshot
    comodel_name='stock.quant.history.snapshot' help='Snapshot settings used to generate this line' index=True ondelete='cascade' required=True string='Snapshot settings'
Public methods (0)

No public methods.

New fields (6)
  • generated_date Datetime
    copy=False help='Date when stock.quant.history line have been created.' readonly=True string='Generated date'
  • inventory_date Datetime
    help='The date used to create stock.quant.history as it was for the given date' readonly=True required=True states={'draft': [('readonly', False)]} string='Inventory date'
  • name Char
    compute='_compute_name'
  • previous_snapshot_id Many2one → stock.quant.history.snapshot
    comodel_name='stock.quant.history.snapshot' help='Base snapshot used to generate this snapshot' readonly=True string='Snapshot base'
  • state Selection
    copy=False default='draft' readonly=True required=True selection=[('draft', 'Draft'), ('generated', 'Generated')] string='Status'
  • stock_quant_history_ids One2many → stock.quant.history
    comodel_name='stock.quant.history' help='Generated stock quant history for current snapshot settings.' inverse_name='snapshot_id' string='Stock quant history'
Public methods (2)
  • action_generate_stock_quant_history(self)
  • action_related_stock_quant_history_tree_view(self)
STATUS
STATUSOpen migration PR - not merged yet for this version
REPOSITORY
REPOSITORYOCA/stock-logistics-reporting
PULL REQUEST
PULL REQUEST[18.0][MIG] stock_quant_history (#436)