On 01 May 06:21, TPH wrote:
> 
> >
> > You need to set the product in context before find locations
> >
> Product = Model.get('product.product')
> Location = Model.get('stock.location')
> 
> (product,) = Product.find([('code', '=', product_code)])
> config.context['product'] = product.id
> 
> (location,) = Location.find([('type', '=', 'storage'), ("name", "=", 
> location_name)])
> config._context['locations'] = [location.id]

You must not set the context like that but you must use the context
manager of proetus.config.set_context

> Same result. Product quantity shown. Location quantity not.
> 
> Also tried:
> config.*_*context['product'] = product.id # TypeError: can't compare 
> datetime.date to NoneType
> 
> 
> 


-- 
Cédric Krier - B2CK SPRL
Email/Jabber: [email protected]
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Reply via email to