Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
3187 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
čvn 23
3083
2
bře 21
2819
1
lis 19
6076
0
lis 18
2759
2
bře 24
5887