Hi Francisco

2017-08-17 2:01 GMT-03:00 Francisco Maria Moyano Casco <
[email protected]>:

> Hi,
>     I'm using tryton 3.8. I'm trying to make a workflow that goes from
> draft state to request state. I defined the transitions, updates, and
> buttons:
>
>      @classmethod
>      def __setup__(cls):
>        super(myClass, cls).__setup__()
>        cls._transitions |= set((
>           ('draft','request'),
>          ))
>
>        cls._buttons.update({
>           'draft': {
>               'invisible': Eval('state').in_(['request']),
>               },
>           'request': {
>               'invisible': Eval('state').in_(['draft']),
>               },
>               })
>
>     @classmethod
>     @ModelView.button
>     @Workflow.transition('request')
>     def draft(cls, myRequests):
>


I think you have defined wrong the transition decorator or the method
name... For the request button should be something like:
    @Workflow.transition('request')
    def request(cls, myRequests):

(You have mixed transition request and method draft in your code... )

Regards

Sebastián Marró

-- 
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/CAE_jc%2B_wKfBUHNDPXtg2HDzEpRFuQebB2poYBBpxQdBjS%2Bad2g%40mail.gmail.com.

Reply via email to