On 21/08/12 15:22 +0200, Truckparts Hamburg COM wrote:
> 
> > It should be something like that (untested):
> > 
> > stockdate = datetime.date(2012, 1, 1)
> > with Transaction().set_context(stock_date_end=stockdate):
> >     stock_2012_01_01 = product.quantity
> 
> I tried this in different variants but can't get it work.

Normally something like this should work:

    config.context['stock_date_end'] = stockdate
    product = Product(<id>)
    product.quantity

You must set the context before instanciating the record otherwise you
can not know if it was not yet read before.

-- 
Cédric Krier

B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: cedric.kr...@b2ck.com
Website: http://www.b2ck.com/

Attachment: pgpl5VQe8x7iR.pgp
Description: PGP signature

Reply via email to