Contributors mailing list archives

contributors@odoo-community.org

Browse archives

Avatar

Re: Delayed stock valuation in a specific situation

by
Data Dance s.r.o., Radovan Skolnik
- 04/12/2020 13:36:07

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

 

 

Reference