Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
3184 Vistas

I want to know by how much (financially) the adjustment will affect my inventory.


In our industry, adjustments of more than 3% of our average monthly sales can cause us to be out of compliance with the state.


How can I see the "cost" of the adjustment to make sure the variance in a given month is within 3%?

 

Avatar
Descartar
Mejor respuesta

You can add a custom field to the stock.quant model to calculate the financial impact (tested with Odoo 18.0).


Given the following values and costing methods for Products:


The Physical Inventory Menu would then show something like this:

Here, the loss of 1 unit of each product has a financial impact of $29 in lost value.


Custom Field:

Dependencies:

inventory_quantity_set, product_id

Compute:

for record in self:
    cost = 0.0
    if record.inventory_quantity_set:
        product = record.product_id
        if product.cost_method in ['standard', 'average']:
            cost = product.standard_price
        elif product.cost_method == 'fifo':
            valuation_layers = record.env['stock.valuation.layer'].search([
                ('product_id', '=', product.id),('remaining_qty', '>', 0)], order='create_date asc')
            qty_to_consume = abs(record.inventory_diff_quantity)
            cost = 0.0
            for layer in valuation_layers:
                if qty_to_consume <= 0:
                    break
                qty_from_layer = min(layer.remaining_qty, qty_to_consume)
                cost += qty_from_layer * (layer.unit_cost or 0.0)
                qty_to_consume -= qty_from_layer
    record['x_impact'] = record.inventory_diff_quantity * cost


Note: this is a prototype, not a solution, and makes assumptions about how products are deplenished from inventory (financial fifo). Your Odoo Digital Advisor or Odoo Partner can help you implement something similar in your own Odoo database. You can also extend this approach to calculate the percentage variance.

    

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
jun 23
3082
2
mar 21
2819
1
nov 19
6074
0
nov 18
2752
2
mar 24
5880