Stock Valuation Layer Usage
stock_valuation_layer_usage · OCA/stock-logistics-workflow
Renamed to stock_move_valuation_usage in 19.0
-
Security25/25No findings
-
Activity12/25Last human commit 18 months ago
-
Required by5/250 modules depend on it
-
Maturity25/25In 6 Odoo series since 13.0
Heuristic over the facts below, not an audit · How it's computed
Description
This module allows to trace the usage of stock valuation layer. That is, makes it possible to identify in what stock moves was a given valuation layer used, and how much quantity was taken by the particular stock move.
This kind of traceability is important in case that at some point you want to conduct an revaluation (for example, in case that the purchase order price changes after the products have been received into stock).
Also, it changes the way the outgoing layers are created in order to respect the MTO case. When creating the out svl, Odoo takes the first layer available with value. The module stock_valuation_layer_usage arises an issue with that Odoo process. Odoo will take always the oldest svl. However, that is not the case for MTO. When there is a fixed link between the incoming move and the outgoing move, at the time of creating the outgoing svl the system should take the specific incoming svl not just the oldest one. Also, when the case is not MTO, the system should avoid using svl that are "reserved".
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 |
|---|---|---|---|---|
stock_valuation_layer_form |
stock.valuation.layer.form | stock.valuation.layer | form | Inherits stock_account.stock_valuation_layer_form |
stock_valuation_layer_usage_form |
stock.valuation.layer.usage.form | stock.valuation.layer.usage | form | New |
stock_valuation_layer_usage_list |
stock.valuation.layer.usage.list | stock.valuation.layer.usage | list | New |
stock_valuation_layer_usage_pivot |
stock.valuation.layer.usage.pivot | stock.valuation.layer.usage | pivot | New |
stock_valuation_layer_usage_search |
stock.valuation.layer.usage.search | stock.valuation.layer.usage | search | New |
view_move_form_inherit |
stock.move.form.inherit | stock.move | form | Inherits stock_account.view_move_form_inherit |
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 3
-
layer_usage_idsOne2many → stock.valuation.layer.usagecomodel_name='stock.valuation.layer.usage'help='Trace what valuation layers have been used by this move, including the quantities taken.'inverse_name='stock_move_id'string='Valuation Layer Usage'
No public methods.
-
incoming_usage_idsOne2many → stock.valuation.layer.usagecomodel_name='stock.valuation.layer.usage'help='Trace on what stock moves has the stock valuation been used in, including the quantities taken.'inverse_name='dest_stock_valuation_layer_id'string='Incoming Valuation Usage' -
incoming_usage_quantityFloatcompute='_compute_incoming_usages'store=Truestring='Incoming Usage quantity' -
incoming_usage_valueFloatcompute='_compute_incoming_usages'store=Truestring='Incoming Usage value' -
usage_idsOne2many → stock.valuation.layer.usagecomodel_name='stock.valuation.layer.usage'help='Trace on what stock moves has the stock valuation been used in, including the quantities taken.'inverse_name='stock_valuation_layer_id'string='Valuation Usage' -
usage_quantityFloatcompute='_compute_usage_values'store=True -
usage_valueFloatcompute='_compute_usage_values'store=True
-
create(self, values)@api.model_create_multi -
write(self, values)
-
company_idMany2one → res.companyreadonly=Truerequired=True args: 'res.company', 'Company' -
dest_stock_valuation_layer_idMany2one → stock.valuation.layercomodel_name='stock.valuation.layer'help='Valuation Layer that was used'required=Falsestring='Destination Stock Valuation Layer' -
product_idMany2one → product.productcomodel_name='product.product'related='stock_valuation_layer_id.product_id'store=True -
quantityFloatstring='Taken Quantity' -
stock_move_idMany2one → stock.movecomodel_name='stock.move'help='Stock move that took the quantities and value from the layer'string='Stock Move' -
stock_valuation_layer_idMany2one → stock.valuation.layercomodel_name='stock.valuation.layer'help='Valuation Layer that was used'required=Truestring='Stock Valuation Layer' -
valueFloatstring='Taken Value'
-
init(self)
Loading…
Loading…
Loading…
Loading…
Loading…