Re: [tryton-dev] Limit of One2Many

2016-11-24 Thread Cédric Krier
On 2016-11-24 19:22, Vincent Bastos wrote:
> On Thu, Nov 24, 2016 at 6:37 PM, Nicolas Évrard 
> wrote:
> 
> > * Vincent Bastos  [2016-11-24 01:38 +0100]:
> >
> >> How can I see what the maximum number of id's a One2Many field returns?
> >>
> >
> > Just specify size=… in the definition of the One2Many
> >
> > http://doc.tryton.org/4.0/trytond/doc/ref/models/fields.html
> > #trytond.model.fields.One2Many.size
> 
> 
> I thought that field was used to limit the number of records?
> 
> I didn't want to limit the number of child records. I wanted to limit the
> number of id's returned in a model.x.read call.

You can not because reading a One2Many means getting all the values for
data integrity.

> It's ok though, I am no longer using the one2many field to get some ids'.

Of course, if you want just some (which means it is not really a
One2Many) the proper way is to use a relate action (searching on the
target model with the right domain and limit).

-- 
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-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton-dev/20161124092826.GS67642%40tetsuo.


Re: [tryton-dev] Limit of One2Many

2016-11-24 Thread Vincent Bastos
On Thu, Nov 24, 2016 at 6:37 PM, Nicolas Évrard 
wrote:

> * Vincent Bastos  [2016-11-24 01:38 +0100]:
>
>> How can I see what the maximum number of id's a One2Many field returns?
>>
>
> Just specify size=… in the definition of the One2Many
>
> http://doc.tryton.org/4.0/trytond/doc/ref/models/fields.html
> #trytond.model.fields.One2Many.size


I thought that field was used to limit the number of records?

I didn't want to limit the number of child records. I wanted to limit the
number of id's returned in a model.x.read call.

It's ok though, I am no longer using the one2many field to get some ids'.

Cheers

-- 
*Vincent Bastos*
*Lava Lab Software*

-- 
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/CACLX58Dr4kd1GUx2_h7RNZW_5SgDZf54D%3Dhprk75xcdn8EoKQQ%40mail.gmail.com.


Re: [tryton-dev] Limit of One2Many

2016-11-24 Thread Nicolas Évrard
* Vincent Bastos  [2016-11-24 01:38 +0100]: 

How can I see what the maximum number of id's a One2Many field returns?


Just specify size=… in the definition of the One2Many

http://doc.tryton.org/4.0/trytond/doc/ref/models/fields.html#trytond.model.fields.One2Many.size

--
Nicolas Évrard - B2CK SPRL
E-mail/Jabber: nicolas.evr...@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-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton-dev/20161124083736.4ooc4qzvsv2mijjk%40localhost.localdomain.


[tryton-dev] Limit of One2Many

2016-11-23 Thread Vincent Bastos
How can I see what the maximum number of id's a One2Many field returns?

-- 
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/9b026ef5-39b5-4c8b-b147-e75a7685dbbc%40googlegroups.com.