Skip to Content
Menu
This question has been flagged
1 Reply
1316 Views

Hi,


I want to show ONLY 15 records on res.partner.tree to the user.


I have already changed the action to call for the 15 records:



But the problem is that the user can click on 1-15 and change it to whatever number they want, like 1-100 and it will work


How can I restrict an user from doing that?

If that's not possible, how can I restrict everyone from clicking on 1-15 ?

Avatar
Discard
Best Answer

Hi,

 In your tree view give limit="15"

<tree string="" limit="15">

</tree>

OR

Try adding this in your xml file in your action:

<field name="limit">15</field>

Try Following,

for example,

<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">15</field>

    <field name="view_mode">tree,form</field>

</record>

Hope this helps,

Thanks

Avatar
Discard
Author

As far as I'm aware, using <field name="limit">15</field> will be the same as configuring it manually (like I did on my first photo)

But the problem is that the user can still bypass the limit by clicking on "1-15" (check the second picture)