On 2018-08-07 03:12, Javier Uribe wrote:
> El martes, 7 de agosto de 2018, 11:55:06 (UTC+2), Cédric Krier  escribió:
> > On 2018-08-07 02:02, Javier Uribe wrote:
> > > El martes, 7 de agosto de 2018, 11:00:06 (UTC+2), Cédric Krier  escribió:
> > > > On 2018-08-07 01:26, Javier Uribe wrote:
> > > > > 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?
> > > > 
> > > > Like any other field with the value read.
> > > 
> > > So, can I read a field of a record that doesn't exist yet?, if that so, 
> > > that's my problem I haven't seen how to do that. 
> > 
> > Of course, you can not read a record that does not exist.
> > I was answering about the creation like you said in your previous
> > message.
> > 
> > But the default value of a readonly field is just like the default value
> > of any field. But you must not send the value of readonly field to the
> > server for creation.
> 
> First of all, thanks a lot for your time but I still don't get how to do what 
> I want. I want to read a field function of a record that doesn't exist 
> because I'm creating, so basically when i'm creating a record and it is not 
> saved on the server I only have the default values, but the function fields I 
> understand that the must be filled as well. So what I want is to populate the 
> model with the default values and the function fields. The default_values can 
> be read easily using the RPC method default_get, however the function fields 
> cannot be read from a record that does not exist. 

As I already said. There is nothing special about Function field on the
client side because client side does not know anything about Function
field and should never know anything about it.
So default value for function field are just like any default value of
any kind of field.

Now maybe, you would like to have the field (function or not) been
updated when the user fill the form. This is managed by the on_change
methods:
https://tryton-readthedocs.readthedocs.io/projects/server/en/latest/topics/models/fields_on_change.html
And again, client does not care about Function field or not also for the
on_change feature.



PS: Could you trim your quotes when answering, especially signature,
thanks.
-- 
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

-- 
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/20180807103853.m5uzxkenrod23bd2%40kei.

Reply via email to