how can I change default limit in tree view?

Asked by Cuong

Hi,

I want to change default limit in tree view. current default of 20 is not enough. I want to change to 100.

Thanks,

Question information

Language:
English Edit question
Status:
Solved
For:
Odoo Web Client Edit question
Assignee:
No assignee Edit question
Solved by:
Cuong
Solved:
Last query:
Last reply:
Revision history for this message
Pedro Gracia (lasarux) said :
#1

A quick hack. You could change "act_window" in addons/openerp/controllers/actions.py as:

def act_window(action, data):
    if not action.get('opened'):
        action.setdefault('target', 'current')
        return act_window_opener(action, data)

    for key in ('res_id', 'res_model', 'view_type',
                'view_mode', 'limit', 'search_view'):
        data[key] = action.get(key, data.get(key))
    if not data.get('search_view') and data.get('search_view_id'):
        data['search_view'] = str(rpc.session.execute(
                'object', 'execute', data['res_model'], 'fields_view_get',
                data['search_view_id'], 'search', data['context']))
    if data.get('limit'):
        data['limit'] = 100 <--- default value is 20

If you find a better solution, please, write me. :-)

Revision history for this message
Cuong (bhcuong2008) said :
#2

Thank you very much. It's a great help :)

Revision history for this message
Cuong (bhcuong2008) said :
#3

Hi Pedro,

Now I find the better solution.
You just comment out these codes.
===
    if data.get('limit'):
        data['limit'] = 100 <--- default value is 20
===
limit is controlled by module ir.actions.act_window. You can change for each view in Administration section. By default, it is 80.

Regards,

Revision history for this message
Ferdinand (office-chricar) said :
#4

the only real good solution is implemented in Koo
* the records are loaded dynamically during scrolling
* column sort is always applied to the complete set of resulting records - very important !!!

Revision history for this message
Pedro Gracia (lasarux-d) said :
#5

Coung, thanks!

Ferdinand, I don't know if that cool stuff is in 6.1 web clieat already...