Am Freitag, 19. Juni 2015 15:57:15 UTC+2 schrieb Guillem Barba Domingo: > > 2015-06-19 11:46 GMT+02:00 TPH <[email protected] <javascript:>>: > >> 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") >> > > 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 > > > > -- > Guillem Barba > http://www.guillem.alcarrer.net >
Late answer, but just want to say thank you, it is working and I use :-) -- 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/a6e29c90-1941-453d-88c7-791337ef7e1a%40googlegroups.com.
