Skip to Content

Contributors

Re: Delayed stock valuation in a specific situation

Pedro,

 

did I tell you previously that you're my hero? You are. Thank you!!!

Let me check if I understand the code correctly (mainly product_cost_price_avco_sync):

  • stock.picking action_done prevents all associated stock.moves from running cost_price_avco_sync
  • cost_price_avco_sync is run when stock.move is updated with price_unit or quantity_done from somewhere else than stock.picking action_done - i.e. updating from PO as in purchase_stock_price_unit_sync
  • cost_price_avco_sync processes not yet processed in(side) movements only in date order
  • in that it looks into approriate history for stock level and price, calulates new values
  • after that looks for affected moves - i.e. moves that have the same product_id and occured later and processes these. Here I see an assumption on subsequent in(side) moves that they are with the same price as the initial one. Is that right?

So I guess this pretty much covers what I need. I guess with some modification this could be used also to restart the stock valuation calculation from a certain point - i.e. I made an initial mistake on incoming move valuation.

 

Do I understand it correctly? Thank you very much again. If I might be so daring - I posted another question regarding calendar view. Would you be so kind and have a look at it? Thank you.

 

Best regards

 

Radovan

 

On piatok 4. decembra 2020 11:16:51 CET Pedro M. Baeza (Tecnativa) wrote:

> See

> https://odoo-community.org/shop/product/product-cost-price-avco-sync-5169

> [1] and

> https://odoo-community.org/shop/product/purchase-stock-price-unit-sync-5062

> [2] Regards.

>

> _______________________________________________

> Mailing-List: https://odoo-community.org/groups/contributors-15 [3]

> Post to: mailto:contributors@odoo-community.org

> Unsubscribe: https://odoo-community.org/groups?unsubscribe [4]

>

>

>

> [1]

> https://odoo-community.org/shop/product/product-cost-price-avco-sync-5169

> [2]

> https://odoo-community.org/shop/product/purchase-stock-price-unit-sync-5062

> [3] https://odoo-community.org/groups/contributors-15

> [4] https://odoo-community.org/groups?unsubscribe

 

 


by Radovan Skolnik - 01:41 - 4 Dec 2020

Reference

  • Delayed stock valuation in a specific situation
    Hello,
    
    another peculiar problem which occurs quite often here in Slovakia in SO-PO 
    scenarios. By the law we use Average Cost for stock valuation. I am not 
    skilled enough in accounting and stock valuation principles so I might be 
    guessing here and there - especially on how Odoo worksin this regard. Feel 
    free to correct where necessary.
    
    In certain situations it can happen that you receive a product from vendor but 
    you don't have an invoice for that yet and don't know exact price. I know it 
    sounds strange but we work as partners with certain producers and sometimes we 
    just do not have 100% updated pricelists. We do not use RfQs and just straight 
    order - usually with zeroed prices and wait for invoice to fill them in. You 
    want to ship the product to the customer ASAP. Now in here they solve it using 
    what is called "delayed stock out" (not sure about correct translation). The 
    idea here is that because we didn't receive the invoice from vendor yet, we 
    cannot calculate stock value yet. But at the same time we need to send the 
    product to customer with customer invoice. But in that case we cannot 
    recalculate stock value because we do not yet know the average value (because 
    that depends on that invoice we're yet to receive).
    
    Have you stumbled upon anything similar? Is there an existing way to deal with 
    this? As far as I understand the inner working of Odoo here, the value of 
    incoming stock is taken from POL and put into stock.move to be later used for 
    stock value recalculation. But we might not have the correct price in POL.
    
    The way AFAIK various accounting softwares deal with this is to put the 
    incoming stcok value recalculation into some kind of queue until the invoice 
    comes in and then process them. But that also means putting into that queue 
    all the other moves regarding the same product. Implementing this into Odoo 
    seems quite a big change.
    
    Any kind of help is welcome. Best regards
    
    	Radovan Skolnik
    
    
    

    by Radovan Skolnik - 11:05 - 4 Dec 2020