Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
3251 Lượt xem

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%?

 

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

    

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 6 23
3116
2
thg 3 21
2868
1
thg 11 19
6114
0
thg 11 18
2810
2
thg 3 24
6013