On 2015-09-15 11:44, Alejandro Brunacci wrote:
> Hi everybody! 
> 
> I'm having troubles in my code with the Workflow... 
> 
> If I use a @workflow.transitions decorator in this method:
> 
>     @classmethod
>     @ModelView.button
>     @Workflow.transition('sended')
>     def sendmail(cls,bitsons):
>         for b in bitsons:
>             print b.email
>  
> 
> I get an empty list in "bitsons"... but if I take off the decorator i get 
> the result that I want
> 
>     @classmethod
>     @ModelView.button
>     def sendmail(cls,bitsons):
>         for b in bitsons:
>             print b.email
> 
> 
> You can see the entire code in: https://bitbucket.org/Abrunacci/bitson_trial
> 
> Please, i need to know what is wrong with this and how i can fix it.

I think nothing is wrong. The transition decorator remove all records
which are not eligible for the transition. So I guess your button states
are not coherent with the Workflow._transitions.

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

Reply via email to