On 2016-03-22 09:57, TPH wrote:
> 
> 
> Am Dienstag, 22. März 2016 13:05:04 UTC+1 schrieb TPH:
> >
> > Hello,
> >
> > I just wrote this question in the German group, but I think here are much 
> > more people. Ill will keep both articles updated.
> >
> > What is the best way to get product stock directly from database?
> >
> > For a webshop / ebay sync I need the stock for every product of the 
> > warehouse. I have tried this with proteus, but this is not fast enough.
> >
> > So I am searching for an way, to get the actually stock of product on the 
> > warehouse.
> >
> > I think I have to use  "stock_location" and "stock_move". Maybe someone 
> > have already a snipped or can give me some hints.
> >
> > Thank you very much.
> >
> >
> This is now my first draft to get the stock directly from database, first 
> only for an specific product. Optimization tips are welcome. I don't have 
> sub-locations so I don't have to search for other locations then parent = 
> warehouse.

I still don't understand why you don't use the quantity on Product.
The Tryton code to compute the quantity is quite complex because it has
a lot of improvements that you will probably miss by reimplementing it
like: using SQL SUM (right order), reuse stock period cache, take care
of assignation, take care of the effective date etc.

If proteus is not fast enough when computing product per product, you
can make yourself the RPC call for the list of products.

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

-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/20160322180818.GL28248%40tetsuo.

Reply via email to