تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3 الردود
2456 أدوات العرض

how can i handle a huge number of results shown in an embedded tree-View


in res.partner we added:

all_sale_order_lines = fields.One2many('sale.order.line', 'order_partner_id', string="Sale Lines", domain=[('state', '!=', 'draft')])


and the part in the View:

<field name="all_sale_order_lines">

<tree create="false" delete="false" default_order="write_date asc">
<field name="write_date" invisible="1" />
<field name="order_id" />
<field name="product_id" />
<field name="name" />
</tree>
</field>  


one of our customers now has more than 35000 Sale Order lines and so the browser crashes.

how should this be handeled?


الصورة الرمزية
إهمال
أفضل إجابة

I tried limit="n" in v17 in the survey.survey form view and it worked. 

I created a survey with nearly 100 questions and with a reload after saving a record the limit was set back to 40 entries. That's really annoying. With the xml code "limit="150" I solved this problem. After reloading all records are shown in my form view. In the xml view this looks as shown below.






الصورة الرمزية
إهمال
الكاتب أفضل إجابة

again: does nobody have such problems with huge amount of data in embedded trees?

the borwser nearly crashes while loading the data.

we have extended the customer and try to show all sale order lines of the customer in a sub tree-view. LIMIT does not help because still all the data will still be sent to the browser (but only the first XXX will be shown).


الصورة الرمزية
إهمال
أفضل إجابة

​Hi,
If you don't want to display all the records you can try to limit records visibility to 10-20 latest records by using limit along with tree view.

<tree create="false" delete="false" default_order="write_date asc" limit="20">

Thanks

الصورة الرمزية
إهمال
الكاتب

ok but i think the hute amount of data will still be sent to the browser. or not?