El 26/02/14 13:51, Jesús Martín Jiménez ha escrit:
Hi,

I need to set dinamically the selection values of functional field of type selection. Something like that:

    selection = fields.Function(fields.Selection('get_selection', 'Value',
            states={
                'invisible': Eval('field_type') != 'selection',
}, depends=['field_type'], on_change_with=['model', 'field']),
        'on_change_with_selection', setter='set_value')

    @staticmethod
    def get_selection():
        ....

    def on_change_with_selection(self, ...):
        ....

But it seems that is not possible to mix this kind of methods in these type of fields because get_selection is an RCP method not allowed. Is it possible to do this? And in affirmative case, how?

You must manually add get_selection to model RPC. You can find an example on:

http://hg.tryton.org/modules/account/file/8edd6f64d461/move.py#l563

Thanks,


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

Reply via email to