Find products by location with Proteus and Tryton 3.2

53 views
Skip to first unread message

TPH

unread,
Jun 19, 2015, 6:15:03 AM6/19/15
to try...@googlegroups.com
Hello

I can't find the correct way to show products by location using Proteus and Tryton 3.2 and need some help please:

xmlrpc_config = proteus.config.set_xmlrpc(url)
User = Model.get('res.user')
xmlrpc_config
.context['language'] = 'de_de'
xmlrpc_config
._context = User.get_preferences(True, config.context)
xmlrpc_config
._context['stock_date_end'] = datetime.datetime.today()

Location = Model.get('stock.location')
Product = Model.get('product.product')

(location,) = Location.find(['name', '=', 'LOCATIONNAME'])

   
stock_by_location_wizzard  
= Wizard('stock.products_by_locations', [location])
stock_by_location_wizzard
.execute("open")

regards

Johannes

Guillem Barba Domingo

unread,
Jun 19, 2015, 9:57:15 AM6/19/15
to try...@googlegroups.com
I don't know if it's possible to do with wizard.
What I do is prepare the context, that is what the wizard does:

with config.set_context({'locations': [location.id], 'stock_date_end': today}):
    products_with_stock = Product.find([('quantity', '>', 0)])
    for product in products:
        print product.quantity

TPH

unread,
Jun 22, 2017, 9:15:05 AM6/22/17
to tryton
Late answer, but just want to say thank you, it is working and I use :-) 
Reply all
Reply to author
Forward
0 new messages