On 05/10/12 12:58 -0700, Miguel Tasende wrote:
> Thank you! I could have been a lot of time searching for it. But still 
> doesn't work to me.
> 
> I added to the Algo class:     _rpc = {'apreto':True}
> to the code, but still the same message. I tried other ways of saying 
> "True" but none works (putting it under a string, using 1, "1",True,"True" 
> not working).
> What am I doing wrong? (I have the intuition that it may be something very 
> stupid and I'll be ashamed to have asked but still can't find it. If you 
> have any piece of working code that I could see it would be great.)
> 
> 
> The final code is:
> 
> class Algo(ModelSQL,ModelView):
>     'Algo'
>     _name = 'hello.algo'
>     _description = __doc__
>     _rpc = {'apreto':True}
> 
>     name = fields.Char('Nombre')
>     holas = fields.Many2Many('hello.relacion','algo','hola','Holas')
>     cosa=fields.Char('Cosa')
> 
>     def apreto(self,ids):
>         for elem in self.browse(ids):
>             elem.cosa="lelele"

_rpc is set in __init__ so you must do:

    def __init__(self):
        super(Algo, self).__init__()
        self._rpc['apreto'] = True


PS: Please don't top-post on this mailing list, see
http://groups.tryton.org/netiquette

-- 
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/

Attachment: pgp1xlFk47wdr.pgp
Description: PGP signature

Reply via email to