Перейти к содержимому
Odoo Меню
  • Войти
  • Попробовать бесплатно
  • Модули
    Финансы
    • Бухгалтерия
    • Выставление счетов
    • Расходы
    • Таблицы
    • Документооборот
    • Подпись
    Продажи
    • CRM
    • Продажи
    • POS Магазин
    • POS Ресторан
    • Подписки
    • Аренда
    Вебсайты
    • Конструктор вебсайтов
    • eCommerce
    • Блог
    • Форум
    • Онлайн-чат
    • Электронное обучение
    Логистика
    • Склад
    • Производство
    • PLM
    • Закупки
    • Обслуживание
    • Качество
    Отдел кадров
    • Сотрудники
    • Подбор персонала
    • Отпуска
    • Оценка персонала
    • Реферальная программа
    • Автопарк
    Маркетинг
    • SMM
    • E-mail рассылки
    • СМС рассылки
    • Мероприятия
    • Автоматизация маркетинга
    • Опросы
    Услуги
    • Проекты
    • Табели
    • Выездной сервис
    • Поддержка
    • Планирование
    • Встречи
    Продуктивность
    • Обсуждения
    • Согласование
    • IoT
    • VoIP-телефония
    • Knowledge
    • WhatsApp
    Сторонние приложения Модуль Студия Odoo Платформа Odoo Cloud
  • Индустрии
    Розничная торговля
    • Книжный магазин
    • Магазин одежды
    • Мебельный магазин
    • Продуктовый магазин
    • Строительный магазин
    • Магазин игрушек
    Гостинично-ресторанный бизнес
    • Бар и паб
    • Ресторан
    • Фастфуд
    • Гостевой дом
    • Дистрибьютор напитков
    • Отель
    Недвижимость
    • Агентство недвижимости
    • Архитектурное бюро
    • Строительство
    • Управление недвижимостью
    • Ландшафтный дизайн
    • Товарищество собственников жилья
    Консалтинг
    • Бухгалтерская фирма
    • Партнер Odoo
    • Маркетинговое агентство
    • Юридическая фирма
    • Подбор персонала
    • Аудиторское бюро
    Производство
    • Текстиль
    • Металл
    • Мебель
    • Продукты питания
    • Пивоварня
    • Корпоративные сувениры
    Здоровье и фитнес
    • Спортивный комплекс
    • Магазин оптики
    • Фитнес-клуб
    • Велнес-центр
    • Аптека
    • Салон красоты
    Услуги
    • Специалист по бытовым услугам
    • Продажа и обслуживание IT-оборудования
    • Солнечные энергосистемы
    • Производство обуви
    • Клининг
    • Системы ОВКВ
    Прочее
    • Некоммерческая организация
    • Консалтинг в сфере устойчивого развития
    • Аренда рекламных щитов
    • Бизнес по фотосъемке
    • Прокат велосипедов
    • Реселлер программного обеспечения
    Все индустрии
  • Community
    Обучение
    • Видео уроки
    • Документация
    • Сертификация
    • Тренинг
    • Блог
    • Подкаст
    Образование и развитие
    • Образовательная программа
    • Деловая игра Scale Up!
    • Экскурсия в офис Odoo
    ПО
    • Скачать
    • Сравнить версии
    • Релизы
    Сотрудничество
    • Github
    • Форум
    • Мероприятия
    • Перевод
    • Стать партнером
    • Услуги для партнеров
    • Зарегистрировать бухгалтерскую фирму
    Услуги
    • Найти партнера
    • Найти бухгалтера
    • Встреча с экспертом
    • Услуги по внедрению
    • Отзывы клиентов
    • Поддержка
    • Обновления
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Заказать демонстрацию
  • Цены
  • Поддержка

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Бухгалтерия
  • Склад
  • PoS
  • Проекты
  • MRP
All apps
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Все посты Люди Значки
Теги (Смотреть все)
odoo accounting v14 pos v15
Об этом форуме
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Все посты Люди Значки
Теги (Смотреть все)
odoo accounting v14 pos v15
Об этом форуме
Помощь

Overriding number of items in a Kanban view with a custom module

Подписаться

Получайте уведомления о появлении активности в этом посте

Этот вопрос был отмечен
javascriptv8webinheritancekanban
6 Ответы
12486 Представления
Аватар
Timo Talvitie, Vizucom Oy

I would like to customize the number of items a kanban view shows before the user has to click the 'show more' button. In addons/web_kanban/static/src/js/kanban.js there is the following snippet of code:

 

instance.web_kanban.KanbanView = instance.web.View.extend({
    template: "KanbanView",

    ...
    init: function (parent, dataset, view_id, options) {
        this._super(parent, dataset, view_id, options);
        ...
        this.limit = options.limit || 40;
        ...
    },

Is there any way I can access the options variable from a custom module and set/override the limit value there?

This post https://www.odoo.com/forum/help-1/question/how-to-show-more-than-40-items-in-kanban-view-25752 provides a solution for setting the number of items, but it involves hardcoding the value in the original js file, but that's a bit tedious to maintain in the long run.

 

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

Gary's problem is related I get the exact same thing when I add this code. From the looks of it for a custom view the options.limit can be overridden, so if you do not want this globally you could add this attribute to the existing view. I have tried this, but I am so far unsuccessful. I have tried adding options="{'limit': 80}" to many places in the xml and I tried adding the options parameter to the python that renders my action to no avail.


UPDATE: <kanban limit="2000"> now works in version 9, this is very recent code update as the code that makes this work did not exist in my dev environment but did in my test environment so update if it does not work for you.

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

Indeed, the best option is to create your own js file inside your custom module. Once you do that, this should be the code to override the options for that instance:

    openerp.your_mod = function(instance, local) {
 
        instance.web_kanban.KanbanView = instance.web_kanban.KanbanView.extend({
            init: function (parent, dataset, view_id, options) {
                if (dataset._model.name == 'your_mod.object') { 
                    options.limit = 12;    //Imposed limit for my particular object
                }
                this._super(parent, dataset, view_id, options);
        }
    });
    instance.web.views.add('kanban_your_mod_limit', 'instance.your_mod.KanbanView');

3
Аватар
Отменить
Gary Walters

When I try this code, I get the following error in my browser Console. Any idea how to debug this further? boot.js:195 error: Some modules could not be started Failed modules: ["web.web_client"] Non loaded modules: ["base.apps", "im_odoo_support.OdooSupport", "__job1", "mail.chat_client_action", "mail.ChatComposer", "mail.chat_manager", "mail.Chatter", "mail.systray", "mail.window_manager", "mail_tip.mail_tip", "web.planner", "web_settings_dashboard"]

Nicolas Bustillos

I can't really tell. Doesn't seem to be related to the piece of code above. Try posting a separate Question to get a broader attention from all experts. Also, make sure to put as much context as possible (excerpts of code if possible)

Dr Obx

My kanban view is overloaded by boxes ;) So i need some solution as well ;) In my module which will be used to move whole locations from one place to another i would like to limit the amount of boxes to for example 4 kanban columns. With my over 500 locations i should save a lot of time. Now when I have to refresh it takes a minute before anything appears on the screen :( Once I manage to add a limit of columns it should be much quicker :)

Nicolas Bustillos

The kanban columns (or lanes) are a whole different story I'm afraid. And tackling this via Javascript like the example above could turn out to be much more complicated. As you might notice, there is a prebuilt "options.limit" variable that already does the heavy lifting for the original question here... so it was a matter of overwriting it at some specific point. But I don't think there is such a thing for the number of columns/lanes. Maybe you should simply resort to 'domains' on the server side (python and xml). You could easily specify which 4 locations you want to display in your Window Action xml definition (something like: "[('location_id','in',[3,6,11,20])]"), which would guarantee you that only those 4 columns/lanes will be displayed (assuming your view is grouped by location_id of course). If you want to do something more sophisticated, you could resort to a wizard that somehow will dynamically determine which 4 locations get to be displayed, and call the Window Action via a python return (with the dynamically constructed domain therein)

Не оставайтесь в стороне – присоединяйтесь к обсуждению!

Создайте аккаунт сегодня, чтобы получить доступ к эксклюзивным функциям и стать частью нашего замечательного сообщества!

Регистрация
Похожие посты Ответы Просмотры Активность
How do redeclare core js function in Odoo 11?
javascript web kanban odooV11
Аватар
0
нояб. 19
3393
Change onclick kanban project view (JS file)
javascript inheritance
Аватар
Аватар
1
мар. 22
7659
How to dont lost selected items in view (web addon)
javascript web
Аватар
1
авг. 16
5798
[javascript] Kanban view Решено
javascript kanban
Аватар
2
мар. 16
6127
How do i switch a view one time you call it from JavaScript.
javascript web
Аватар
0
мар. 15
5107
Сообщество
  • Видео уроки
  • Документация
  • Форум
Открытый исходный код
  • Скачать
  • Github
  • Runbot
  • Перевод
Услуги
  • Хостинг Odoo.sh
  • Поддержка
  • Обновление
  • Индивидуальные решения по доработке
  • Образование
  • Найти бухгалтера
  • Найти партнера
  • Стать партнером
О нас
  • Наша компания
  • Активы бренда
  • Cвяжитесь с нами
  • Вакансии
  • Мероприятия
  • Подкаст
  • Блог
  • Клиенты
  • Правовые документы • Конфиденциальность
  • Безопасность
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo – это набор бизнес-модулей с открытым исходным кодом, который закроет все потребности вашей компании: CRM, E-commerce, Бухгалтерия, Склад, POS, управление проектами и др.

Odoo сочетает в себе простоту использования и полную интеграцию всех бизнес-процессов в одной системе.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now