跳至内容
菜单
此问题已终结
3 回复
2453 查看

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?