Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1550 Lượt xem

I have 50cr+ records in a custom table and display using Qweb reports template.

Its loading faster for less than 1cr records but taking time for larger data.


I applied index, vacuum in database and loading faster inside PgAdmin tool.


Date stored in Custom table "ls_hq_stock_attribute_view". We are trying to get data with Date filter.


Can anyone please clarify, How the QWeb reports working and connect with Database?


Is the python function query all records from the table?

Ảnh đại diện
Huỷ bỏ
Tác giả

Python Code:
if self.company_id.company_registry == 'HQ':
search_fields = [('stock_date','=',self.start_date)]
else:
search_fields = [('stock_date','=',self.start_date),('loccode','=',self.company_id.company_registry)]
action = self.env.ref('ls_pos_reports.ls_hq_stock_attribute_view').read()[0]
action.update({'domain':search_fields})
return action

XML View:
<record id="ls_hq_stock_attribute_view"
model="ir.actions.act_window">
<field name="name">Stock Attribute</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">ls.hq.stock.attribute.view</field>
<field name="view_mode">tree,pivot,graph</field>
<field name="target">current</field>
</record>
<record model="ir.ui.view" id="ls_hq_stock_attribute_tree">
<field name="name">LS HQ Stock Attribute Tree</field>
<field name="model">ls.hq.stock.attribute.view</field>
<field name="arch" type="xml">
<tree string="Stock Attribute" edit="false" create="false" delete="false" export_xlsx="false" class="mytree">
<field name="stock_date" optional="show" />
<field name="loccode" optional="show" />
<field name="name" optional="show" />
<field name="dept" optional="show" />
<field name="category" optional="show" />
<field name="subcategory" optional="show" />

</tree>
</field>
</record>

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 7 25
1976
1
thg 5 25
2091
1
thg 4 25
2491
1
thg 2 25
1769
0
thg 10 24
1508