Right now to get the list of products along with their quantities I use:
ProductsByLocation = Model.get('stock.products_by_locations')
with config.set_context ( locations = [warehouse.id] ):
products = ProductsByLocation.find('')
for product in products: print(product.quantity)
However, I have two issues:
Looping over products and executing product.quantity for each product is pretty slow. In the client, it happens pretty quickly. How can I read the quantities faster?
How can I set the âAt Dateâ in proteus like in the client (for Products by Locations)?
Any solution must also be usable for calculating cost_value for the products.
PS. Searching for products and getting quantity or cost_value is equally slow, since itâs done one by one over a loop.
proteus does not do batch reading even for record instantiated from the same search.
It does not have the group mechanism that other clients have but it could be a nice addition as more and more people are using it as production tool. https://bugs.tryton.org/issue2723