Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
So, within a form view I have an embedded tree view (one2many field). This embedded view, by default, shows 80 results before it starts paging. As this is an embedded view, the number of results is simply too much to be useful. Ideally, I want to limit the number of results to 10.
Now, I have found how to change the number of results system wide but that is not what I want. I only want to change the number of results on this one single view whilst leaving the other views unaffected. Is this functionality possible? If it is not possible out of the box, has anyone written any code to update the web client to make it possible?
Code in question:
<field name="activitylog" colspan="3" nolabel="1" > <tree string="Activity Log Entries"> <field name="entry_date" /> <field name="activity_type" /> <field name="name" /> <field name="state" /> <field name="contact_id" /> <field name="user_id" /> <button type="object" string="Open Activity" name="button_view_activity" icon="gtk-open" /> </tree> </field>
I want that tree view to be limited by results. Many thanks
Hi Alex, Try
in your action (XML file).
<record id="action_your_object_form" model="ir.actions.act_window"> <field name="name">Your Object Name</field> <field name="type">ir.actions.act_window</field> <field name="res_model">your.object</field> <field name="view_type">form</field> <field name="limit">150</field> <field name="view_mode">tree,form</field> </record>
Hope this work for you.
A quick fix which shows only 10 items at a time on sales order. Go to settings-->customization-->window actions--> look for the sales order window action and edit/change the Limit from 80 to 10 or to any number you wish to reduce the number of items displayed at a time to. You may have to add this number of items in the .js (C:\Program Files (x86)\OpenERP 6.1-1\server\openerp\addons\web\static\src\js open view_list.js and add to the list bwt line 273 and 278) file of web module as well. That is what I have done to reduce the number of items displayed in tree view of Sales Order. This does not however stop you from creating more that 10 items which i think is what you want. If you locate the window action of module of interest you can apply this same process to it.
if changed \addons\web\static\src\js\view_list.js, like add 'limit': 18, on odoo 8.0, the all tree views will change to limited number of 18, even you've setup limited number on action view.
I would ask question again: I only want to change the number of results on this one single view whilst leaving the other views unaffected. Is this functionality possible?
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 7/3/13, 7:22 AM|
|Seen: 7816 times|
|Last updated: 11/9/16, 8:54 PM|