Re: [tryton] cost price and cost price method

2014-07-07 Thread Cédric Krier
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 ShipmentAccount move
  Quantity  Price   Debit   Credit
 -
 Product_15.00   5.00   25.0025.00
 Product_15.00  10.00   50.0050.00
 
 Customer ShipmentAccount move
  Quantity  Price   Debit   Credit
 -
 Product_17.00   fifo   45.0045.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 TemplateQuantity   Cost Value
 -
 Product_1   3.0011.25
 
 while there should be:
 
 Product TemplateQuantity   Cost Value
 -
 Product_1   3.0030.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/


pgpp_lR0uWrii.pgp
Description: PGP signature


Re: [tryton] cost price and cost price method

2014-07-07 Thread Cédric Krier
On 07 Jul 02:52, Michal wrote:
 Thanks for a quick answer, but your scenario is working while mine is not.
 As I understand cost_price is a calculation of average prices of what is 
 not consumed yet (it is ok for me)
 
 I do the following tests:
 
 Test 1)
 
 Supplier Shipment Account move
 Line No Quantity  Price   Debit   Credit
 --
   1  Product_15.00   5.00   25.0025.00
   2  Product_15.00  10.00   50.0050.00
 
 Customer Shipment  Account move
  Line No Quantity  Price   Debit   Credit
 --
   1  Product_17.00   fifo   45.0045.00 
 
 
 Cost Price  3.75  WRONG PRICE
 --

There is probably a bug when same product is on many lines.
Please report it and even better with a test scenario.

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


pgpGPDfLv6GlJ.pgp
Description: PGP signature


Re: [tryton] cost price and cost price method

2014-07-04 Thread Dominique Chabord
2014-07-04 14:46 GMT+02:00 Michal michal.s...@gmail.com:

Accordingly there is a need to have different account_stock value for the
same product in different warehouses.

do you mean stock value increases when you move a product from
location 1 to location 2 and decreases if you move it back ?
Are you sure we talk about the save cost ?


Re: [tryton] cost price and cost price method

2014-07-04 Thread Cédric Krier
On 04 Jul 05:46, Michal wrote:
 Hi,
 I'm testing Tryton in a production company and I have a few
 questions about cost_price and cost_price_method used in product,
 product_cost_fifo, account_product and account_stock_continental.
 
 Cost_price_method could be fixed, average and fifo.
 Cost_price is a part of a product.template model.
 
First consequence I have noticed is that calculating amount
in stock move lines we have always one price for a product in a whole 
 company.
Is there a possibility to have different cost prices in different
warehouses ?
For example I can have 2 warehouses in 2 departments of my
company, each of them in different city. If I have the same product in
both of them and I make a move from supplier or production to one
of them the cost_price is changing in both of them (cost_price_method =
average).
Accordingly there is a need to have different account_stock value for the
same product in different warehouses.

This is not supported by Tryton for now. But it could be an improvement
to add a extra computation of cost price per warehouse.

Second consequence is that when I make 2 moves from supplier or 
 production
to warehouse in different prices (cost_price_method = fifo) cost_price
on product form is not displayed properly.
Why is there any value ? Could it be a list of a current fifo_quantities
like in product.template.get_fifo_move() instead of showing a value.

I don't understand.


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


pgp4psmLJy63M.pgp
Description: PGP signature


Re: [tryton] cost price and cost price method

2014-07-04 Thread Michal


On Friday, July 4, 2014 3:42:28 PM UTC+2, Cédric Krier wrote:

 On 04 Jul 05:46, Michal wrote: 
  Hi, 
  I'm testing Tryton in a production company and I have a few 
  questions about cost_price and cost_price_method used in product, 
  product_cost_fifo, account_product and account_stock_continental. 
  
  Cost_price_method could be fixed, average and fifo. 
  Cost_price is a part of a product.template model. 
  
 First consequence I have noticed is that calculating amount 
 in stock move lines we have always one price for a product in a whole 
  company. 
 Is there a possibility to have different cost prices in different 
 warehouses ? 
 For example I can have 2 warehouses in 2 departments of my 
 company, each of them in different city. If I have the same product 
 in 
 both of them and I make a move from supplier or production to one 
 of them the cost_price is changing in both of them (cost_price_method 
 = 
 average). 
 Accordingly there is a need to have different account_stock value for 
 the 
 same product in different warehouses. 

 This is not supported by Tryton for now. But it could be an improvement 
 to add a extra computation of cost price per warehouse. 

OK 


 Second consequence is that when I make 2 moves from supplier or 
  production 
 to warehouse in different prices (cost_price_method = fifo) 
 cost_price 
 on product form is not displayed properly. 
 Why is there any value ? Could it be a list of a current 
 fifo_quantities 
 like in product.template.get_fifo_move() instead of showing a value. 

 I don't understand. 

 
Example with cost price method = fifo:

Supplier Shipement
 Quantity  Price 
Product_15.005.00
Product_15.00  10.00

On Product form you can see:
Cost Price  5.00 -  what for ? it is misleading

Regards 
Filip



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



Re: [tryton] cost price and cost price method

2014-07-04 Thread Cédric Krier
On 04 Jul 16:34, Cédric Krier wrote:
 On 04 Jul 07:02, Michal wrote:
   Second consequence is that when I make 2 moves from supplier or 
production 
   to warehouse in different prices (cost_price_method = fifo) 
   cost_price 
   on product form is not displayed properly. 
   Why is there any value ? Could it be a list of a current 
   fifo_quantities 
   like in product.template.get_fifo_move() instead of showing a value. 
  
   I don't understand. 
  
   
  Example with cost price method = fifo:
  
  Supplier Shipement
   Quantity  Price 
  Product_15.005.00
  Product_15.00  10.00
  
  On Product form you can see:
  Cost Price  5.00 -  what for ? it is misleading
 
 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.


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


pgpBowS1awb9I.pgp
Description: PGP signature