El miércoles, 27 de enero de 2016, 11:17:47 (UTC+1), raimonesteve escribió:
>
> 2016-01-27 11:07 GMT+01:00 Jesús Martín Jiménez <[email protected] 
> <javascript:>>: 
> > Hi 
> > 
> > El martes, 21 de agosto de 2012, 15:34:32 (UTC+2), Cédric Krier 
> escribió: 
> >> 
> >> 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 
> > 
> > 
> > I'm trying to set the active_ids param to the context with proteus this 
> way 
> > 
> >>>> Invoice = Model.get('account.invoice') 
> >>>> d = datetime(year=2015, month=12, day=1) 
> >>>> invoices = Invoice.find([('create_date', '>=', d)]) 
> >>>> config.set_context({'active_ids': [i.id for i in invoices]}) 
> > 
> > in order to execute a method of a wizard that takes values from the 
> context 
> > of the transaction, but the transaction context that arrives to the 
> method 
> > has the None value on the active_ids param. 
> > 
> > I've tried these too: 
> > 
> >>>> config.context['active_ids'] = [i.id for i in invoices] 
> >>>> config._context['active_ids'] = [i.id for i in invoices] 
>
> I think is not necessary add active_ids in context. 
>
> An example to call a wizard with some records: 
>
>
> http://hg.tryton.org/modules/account/file/355d38d4a518/tests/scenario_account_reconciliation.rst#l96
>  
>

Thanks, this way works properly.
 

>
> Regards 
>
> > But nothing works properly. I've tested with proteus 3.4.2 and 3.8.1 
> > 
> > Could someone tell me what am i doing wrong? 
> > 
> > Thank you very much. 
> > 
> >> 
> >> 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: [email protected] 
> >> Website: http://www.b2ck.com/ 
> > 
> > -- 
> > 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/c9837995-d4e4-4ded-a663-cb1b52299fde%40googlegroups.com.
>  
>
>
>
>
> -- 
> Si us plau, NO adjunti arxius a les seves respostes. Li preguem que 
> integri el text al cos del missatge. Pot respondre usant NetEtiquete 
> que li ajudarà a seguir la conversa. 
> http://es.wikipedia.org/wiki/Netiquette 
>
> Por favor, NO adjunte archivos a sus respuestas. Le rogamos que 
> integre el texto en el cuerpo del mensaje. Puede responder usando 
> NetEtiquete que le ayudará a seguir la 
> conversación.http://es.wikipedia.org/wiki/Netiquette 
>
> Please, DO NOT send attachment files with your answers, just copy and 
> paste only the text you need to send into the body of your mails. 
> Repply using NetEtiquete. http://en.wikipedia.org/wiki/Netiquette 
>

-- 
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/e1f4c365-9757-4f71-8a1f-cab7683753f2%40googlegroups.com.

Reply via email to