On 07 Jul 01:06, Michal wrote:
> 
> 
> 
> > > This is the average of the remaining product of the fifo stack. 
> >
> > Oops, no it is the next cost price out of the fifo stack. 

I should really read more carefully the code.
It is the average see the test scenario:
http://hg.tryton.org/modules/product_cost_fifo/file/3f9793486d52/tests/scenario_product_cost_fifo.rst#l122

> 
> I did some more tests with incoming and outgoing moves:
> 
> cost price method = fifo
> 
> Supplier Shipment                            Account move
>                  Quantity  Price           Debit   Credit
> ---------------------------------------------------------
> Product_1        5.00       5.00           25.00    25.00
> Product_1        5.00      10.00           50.00    50.00
> 
> Customer Shipment                            Account move
>                  Quantity  Price           Debit   Credit
> ---------------------------------------------------------
> Product_1        7.00       fifo           45.00    45.00
>                                              ^
>                                              |
>                                              +----- 5*5+2*10 - OK
> 
> stock moves - ok
> account moves - ok
> but on Product form you can see:
> Cost Price  3.75     <-   this is neither average price (7.5 in this case)
>                                    nor the one of fifo prices (5 or 10)
> How this value is calculated ?

It is the average but of course it depends on the initial values.

> By the way
> There is also a functional field cost_value in stock module which is also 
> not
> working with fifo cost pricing method.
> You can see cost_value on Inventory & Stock->Locations, dbl click on 
> location
> an there is a report Products by locations.
> 
> There is:
> 
> Product Template    Quantity   Cost Value
> -----------------------------------------
> Product_1               3.00        11.25
> 
> while there should be:
> 
> Product Template    Quantity   Cost Value
> -----------------------------------------
> Product_1               3.00        30.00
> 
> I see that function stock.location.get_cost_value() does simple
> calculation product.cost_price  * location.quantity,
> while it could use function product.template.get_fifo_move()
> from module product_cost_fifo.

This will be too slow so by using the average normally we get the right
value.

-- 
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Attachment: pgpp_lR0uWrii.pgp
Description: PGP signature

Reply via email to