Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
2885 Представления

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

Аватар
Отменить
Лучший ответ

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

Аватар
Отменить
Related Posts Ответы Просмотры Активность
2
июл. 25
8074
2
янв. 25
7165
computed fields Решено
1
апр. 24
3066
1
дек. 23
5526
0
нояб. 23
1709