El lunes, 21 de agosto de 2017, 14:34:33 (UTC-3), Francisco Maria Moyano Casco 
escribió:
> > (You have mixed transition request and method draft in your code... )
> > 
> > 
> > Regards
> > 
> > 
> > Sebastián Marró
> 
> Hello Seba,
>     Thanks for the answer! But, no it isn't that.
> 
>     I'm using the richtext widget on a text field, and that is the problem. 
> When a take it off, the problem is solved by itself. When I put it back, the 
> problem is on again.
> 
>     Can anyone confirm this kind of behaviour? Maybe is a bug.
> 
>     Regards,
>           Francisco

I study all the alternatives, and this how to reproduce this issue:

 1. Make a fields.Char or a fields.Text. For now, we will call it simple_string:
class MyClass(Workflow, ModelSQL, ModelView):
     ....
     simple_string = fields.Char('My string')
     ....
 2. Add now the transitions and define a button to it:
    
     @classmethod
     def __setup__(cls):
       super(MyClass, cls).__setup__()
       cls._transitions |= set((
          ('draft','request'),
         ))

       cls._buttons.update({
          'draft': {
              'invisible': Eval('state').in_(['draft']),
              },
          'request': {
              'invisible': Eval('state').in_(['request']),
              },
              })
       
    @classmethod
    @ModelView.button
    @Workflow.transition('request')
    def request(cls, myRequests):
         ..........
         cls.write(myRequests,{
                 'simple_string': 'something something',
                })

 3. Make a view with a form,menuitem, etc.., and put the field and the button 
on it, but using the richtext widget on the field
     <label name="simple_string"/>
     <field name="simple_string" widget="richtext"/>
     <button name="request" string="_Request"/>

 4. Click on the button, and observe that the form will not be saved as it 
would be without the richtext widget.

 Can anyone confirm this? Thanks

       Francisco

    

   


-- 
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/d57db620-5451-4e9a-af1c-85956cdd6de4%40googlegroups.com.

Reply via email to