Stock Move Actual Date
stock_move_actual_date · OCA/stock-logistics-workflow
-
Security25/25No findings
-
Activity25/25Last human commit 1 month ago
-
Required by15/251 module depends on it
-
Maturity18/25In 3 Odoo series since 16.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): `ALTER TABLE stock_move ADD COLUMN actual_date DATE; UPDATE stock_move SET actual_date = DATE(date);` - re-check the table/column names still match after upgrading. (2 occurrences in this file) 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 adds an Actual Date field to the stock picking, stock scrap, stock move, and stock move line models. This field allows users to record the actual date on which a stock transfer or stock scrap took place, in case the transaction in Odoo is processed after the fact.
It also adds an Actual Date field to the Stock Valuation Layer model, enabling reporting based on this field. This field is computed and stored according to the following logic:
- If a posted journal entry exists, its date is used.
- If there is no journal entry, the stock move's actual date is used
- Otherwise, convert create_date (datetime) of the stock.valuation.layer record to date, with consideration to user's timezone.
It also provides stock quantity history reporting based on the actual date.
Dependencies
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 15
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
stock_move_line_view_search |
stock.move.line.search | stock.move.line | search | Inherits stock.stock_move_line_view_search |
stock_scrap_form_view |
stock.scrap.form | stock.scrap | form | Inherits stock.stock_scrap_form_view |
stock_scrap_form_view2 |
stock.scrap.form2 | stock.scrap | form | Inherits stock.stock_scrap_form_view2 |
stock_scrap_search_view |
stock.scrap.search | stock.scrap | search | Inherits stock.stock_scrap_search_view |
stock_scrap_tree_view |
stock.scrap.tree | stock.scrap | tree | Inherits stock.stock_scrap_tree_view |
stock_valuation_layer_form |
stock.valuation.layer.form | stock.valuation.layer | form | Inherits stock_account.stock_valuation_layer_form |
stock_valuation_layer_search |
stock.valuation.layer.search | stock.valuation.layer | search | Inherits stock_account.view_inventory_valuation_search |
stock_valuation_layer_tree |
stock.valuation.layer.tree | stock.valuation.layer | tree | Inherits stock_account.stock_valuation_layer_tree |
view_move_line_tree |
stock.move.line.tree | stock.move.line | tree | Inherits stock.view_move_line_tree |
view_move_search |
stock.move.search | stock.move | search | Inherits stock.view_move_search |
view_move_tree_actual_date_inherit |
stock.move.tree | stock.move | tree | Inherits stock.view_move_tree |
view_picking_form |
stock.picking.form | stock.picking | form | Inherits stock.view_picking_form |
view_picking_internal_search |
stock.picking.search | stock.picking | search | Inherits stock.view_picking_internal_search |
view_picking_tree |
stock.picking.tree | stock.picking | tree | Inherits stock.vpicktree |
view_stock_quantity_history |
Inventory Report at Date | stock.quantity.history | Inherits stock.view_stock_quantity_history |
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 9
No new fields.
Public methods (0)No public methods.
No new fields.
Public methods (0)No public methods.
-
actual_dateDatecopy=Falsehelp='If set, the value is propagated to the related journal entries as the date.'tracking=True -
is_editable_actual_dateBooleancompute='_compute_is_editable_actual_date'string='Is Editable'
-
create(self, vals_list)@api.model_create_multi -
write(self, vals)
-
actual_dateDatecompute='_compute_actual_date'store=True -
actual_date_sourceDatehelp='Technical field to store the actual_date of the source document.'
-
create(self, vals_list)@api.model_create_multi
-
actual_dateDaterelated='move_id.actual_date'store=True
No public methods.
No new fields.
Public methods (0)No public methods.
No new fields.
Public methods (2)-
open_at_actual_date(self) -
open_qty_at_actual_date(self)
No new fields.
Public methods (1)-
do_scrap(self)
-
actual_dateDatecompute='_compute_actual_date'help="The actual date is determined as follows:\n- If a posted journal entry exists, its date is used.\n- If there is no journal entry, the stock move's actual date is used.\n- Otherwise, the record's creation date (timezone-aware) is used."store=True
No public methods.
Loading…
Loading…
Loading…