Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
2866 Vistas

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
Descartar
Mejor respuesta

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
jul 25
8032
2
ene 25
7142
1
abr 24
3053
1
dic 23
5500
0
nov 23
1698