El 19/10/16 a les 15:38, Diego Abad ha escrit:
El miércoles, 19 de octubre de 2016, 5:54:14 (UTC-5), Markus Bala escribió:

    Hi,

    As we know proteus able to work as Tryton client, able to do Find,
    update, delete, call Button, and Wizard.


    Below is to call button in proteus:
    s = ShipmentIn.find([('reference','=', ref),('state','=','draft')])
    s.click('receive')

    My question is how to call a method by using proteus?

    Example: (how to call method add in proteus?)

    Class StockMove:
        def add(self, val1, val2):
            return val1 + val2


You can find a example on account module, see get_origin method,
there is a definition inside   cls.__rpc__.update

http://hg.tryton.org/modules/account/file/tip/move.py#l689
That's right. You have to add the modules in __rpc__ so they can be called from the client (and proteus also of course).

But normally is not required to do such things, so I'm wondering what you are trying to achieve? Maybe rpc is not the right tool to solve the problem you have.



--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

--
You received this message because you are subscribed to the Google Groups 
"tryton-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton-dev/094841f5-b50f-98cd-d059-7bb7febd663d%40koolpi.com.

Reply via email to