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

<field name = "timesheet_ids" context = "{'default_project_id': project_id}">

                   <tree editable = "top" string = "Timesheet Activities" default_order = "desc date" limit = "20">

                            <field name = "date" />

                            <field name = "user_id" invisible = "1" />

                            <field name = "employee_id" required = "1" />

                            <field name = "name" />

                            <field name = "unit_amount" string = "Duration" widget = "float_time" />

                            <field name = "project_id" invisible = "1" />

                        </ Tree>

                    </ Field>


above this code is working for only editable and default_order attribute. I need to use limit attribute but it could not working. Why removed limit attribute in odoo v11.

形象
丢弃
最佳答案

Limit attribute for list view in odoo v11 is deprecated. so we cant able to use it anymore. 

形象
丢弃
最佳答案

Hello Nidhi,

I tried with xpath and it worked for me.

<xpath expr="//field[@name='timesheet_ids']/tree" position="attributes">
    <attribute name="editable">top</attribute>
    <attribute name="limit">3</attribute>
    <attribute name="default_order">date desc</attribute>
</xpath>

Hope it helps.

Regards,
Mayank Gosai

形象
丢弃
相关帖文 回复 查看 活动
1
12月 18
8890
0
10月 17
5089
4
10月 17
4507
2
4月 23
10873
1
2月 20
7845