Ayuda

2

How to change the default number of lines in listview?

Avatar
ton123

There are a lot of listviews in OpenERP. They work very good and nice. I often use listviews for sales/addresbook/contacts and for products.

The number of lines can be choosen:

  • 24 lines
  • 80 lines
  • 100 lines
  • 200 lines
  • 500 lines
  • unlimited lines

The default value is always: 24.

I would like to have an other default value.

Is it possible to set the default value in the configuration parameters, if so how? E.g. on a system basis, on a per screen basis or is it possible to keep the default value of the last typed in value?

Avatar
Discard
2 Respuestas
7
Avatar
Ray Carnes
Best Answer

The default limit for a list view is set on the corresponding Window Action.


VIA THE USER INTERFACE:

Window Actions are managed via:

Settings -> Customization -> Low Level Objects -> Actions -> Window Actions

Because things like Products can be viewed from many different places ...

Sales -> Products -> Products

Sales -> Products -> Products by Category (and then select a Category)

Purchases -> Products -> Products

Warehouse -> Products -> Products

POS Backend -> Products -> Products

Tools -> Configuration -> Lunch -> Products

... if you search for 'product.product' in the Object field, you will see 6 Window Actions named 'Products'.

So it is better to search for the Menu item, via:

Settings -> Customization -> User Interface -> Menu Items

... and then open the Action from there.

When you do, you will see the default value in the Limit field - and you can change this value from 80 to anything you want:

image description


VIA XML:

Change the limit field in the window action definition:

action add <field name="limit">your_default_limit</field>
1 Comment
Avatar
Discard

This solution update the limit of main model, but what about child view, for e.g. if we want to extend the limit of one2many field. is it possible to do through configuration?

0
Avatar
Saloua.sahnoune
Best Answer

You  just need to add the limit value to your one2many field in python


ex: line_id = fields.One2many('res.user', 'objectif_week', limit=4, default=default_get)

Avatar
Discard