Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
2882 Prikazi

I have odoo 8 and i doing the migration to odoo 12 but.


I have a list of item in my tree view list, if I pick to see my list limit 1-200 then if I open 1 popup that i have in this view as soon as i close the popup my list is restored back to 1-40 and i have odoo 8 and if a close the popup the list remain with the same quantity per page

Avatar
Opusti
Best Answer

Hello,
Try with the below code:odoo.define('my_module.tree_view', function (require) {
    "use strict";

    var ListView = require('web.ListView');
    var core = require('web.core');
    var _t = core._t;
    ListView.include({
        do_show: function () {
            var self = this;
            return this._super.apply(this, arguments).then(function () {
                self.$pager.find('.o_pager_limit').off('change.pager').on('change.pager', _.bind(self._onLimitChange, self));
            });
        },

        _onLimitChange: function (ev) {
            ev.preventDefault();
            this.limit = parseInt(ev.target.value, 10);
            this.reload();
        },
    });
});

Hope it helps

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
2
jul. 25
8069
2
jan. 25
7162
1
apr. 24
3065
1
dec. 23
5523
0
nov. 23
1706