El martes, 7 de agosto de 2018, 10:15:05 (UTC+2), Cédric Krier escribió: > On 2018-08-07 00:50, Javier Uribe wrote: > > Hello, I'm developing a Framework to develop mobile tryton apps so I have > > to comunicate the client mobile with the server. I used the rpc method > > fields_get and default to fill the field's definitions but I'm struggling > > to understand how Tryton fills the fields.function, because the fields_get > > doesn't give you the info about it neither it is a fields.function or its > > function to call, so this field remains empty if I don't fill it manually. > > This is done on purpose. Function fields is a server details. They > must behave like the field they impersonate. So you must not know the > getter, setter or searcher because you can not call them remotely. You > must just use the read/create/write API as for any other fields. > > > When it comes to read a record it is easy because the read rpc method gives > > you the value, the problem comes when I have to create a new record and I > > have to fill it with all the default_values but I can't fill the function > > fields with its values. > > You should but be careful that some function fields have no setter so > they are described as readonly. You should never send value for readonly > fields. We will one day enforce this https://bugs.tryton.org/issue4207 > > -- > Cédric Krier - B2CK SPRL > Email/Jabber: cedric.kr...@b2ck.com > Tel: +32 472 54 46 59 > Website: http://www.b2ck.com/
So, lets say for instance that we have a field moves which is a Fields.function which has a method get_moves(). And I have just created a record that has this field, the fields_get tells me that it is a readonly. How should I fill the field moves with its value? -- 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/1bbde70e-1169-49d5-a96d-cca4363e424e%40googlegroups.com.