Bỏ qua để đến Nội dung
Odoo Menu
  • Đăng nhập
  • Dùng thử miễn phí
  • Ứng dụng
    Tài chính
    • Kế toán
    • Hóa đơn
    • Chi phí
    • Bảng tính (BI)
    • Tài liệu
    • Ký tên
    Bán hàng
    • CRM
    • Bán hàng
    • POS Cửa hàng
    • POS Nhà hàng
    • Đăng ký
    • Cho thuê
    Trang web
    • Trình tạo trang web
    • Thương mại điện tử
    • Blog
    • Diễn đàn
    • Trò chuyện trực tiếp
    • Học trực tuyến
    Chuỗi cung ứng
    • Tồn kho
    • Sản xuất
    • PLM
    • Mua hàng
    • Bảo dưỡng
    • Chất lượng
    Nhân sự
    • Nhân viên
    • Tuyển dụng
    • Ngày nghỉ
    • Đánh giá
    • Giới thiệu
    • Đội xe
    Marketing
    • Marketing trên MXH
    • Marketing qua email
    • Marketing qua SMS
    • Sự kiện
    • Tự động hóa Marketing
    • Khảo sát
    Dịch vụ
    • Dự án
    • Bảng chấm công
    • Dịch vụ hiện trường
    • Hỗ trợ
    • Kế hoạch
    • Lịch hẹn
    Năng suất
    • Thảo luận
    • Phê duyệt
    • IoT
    • VoIP
    • Kiến thức
    • WhatsApp
    Ứng dụng của bên thứ ba Studio Odoo Nền tảng Đám mây Odoo
  • Ngành
    Bán lẻ
    • Nhà sách
    • Cửa hàng quần áo
    • Cửa hàng nội thất
    • Cửa hàng tạp hóa
    • Cửa hàng đồ kim khí
    • Cửa hàng đồ chơi
    Ẩm thực & Dịch vụ lưu trú
    • Bar và quán rượu
    • Nhà hàng
    • Đồ ăn nhanh
    • Guest house
    • Nhà phân phối đồ uống
    • Khách sạn
    Bất động sản
    • Công ty môi giới bất động sản
    • Công ty kiến trúc
    • Xây dựng
    • Quản lý bất động sản
    • Làm vườn
    • Hiệp hội chủ sở hữu bất động sản
    Tư vấn
    • Công ty kế toán
    • Đối tác Odoo
    • Công ty marketing
    • Công ty luật
    • Tuyển dụng
    • Thanh tra & chứng nhận
    Sản xuất
    • Dệt may
    • Kim loại
    • Nội thất
    • Ẩm thực
    • Nhà máy bia
    • Quà tặng doanh nghiệp
    Sức khoẻ & fitness
    • CLB thể thao
    • Cửa hàng kính mắt
    • Trung tâm fitness
    • Chuyên gia chăm sóc sức khỏe
    • Hiệu thuốc
    • Tiệm làm tóc
    Thương mại
    • Dịch vụ sửa chữa
    • Phần cứng CNTT & Hỗ trợ
    • Hệ thống năng lượng mặt trời
    • Công ty sản xuất giày
    • Dịch vụ vệ sinh
    • Dịch vụ HVAC
    Khác
    • Tổ chức phi lợi nhuận
    • Cơ quan môi trường
    • Cho thuê biển quảng cáo
    • Nhiếp ảnh
    • Cho thuê xe đạp
    • Đại lý phần mềm
    Xem tất cả ngành
  • Cộng đồng
    Học tập
    • Khóa học
    • Tài liệu
    • Chứng chỉ
    • Đào tạo
    • Blog
    • Podcast
    Thúc đẩy đào tạo
    • Chương trình đào tạo
    • Trò chơi kinh doanh Scale Up!
    • Tham quan Odoo
    Nhận phần mềm
    • Tải xuống
    • So sánh các phiên bản
    • Phiên bản
    Hợp tác
    • Github
    • Diễn đàn
    • Sự kiện
    • Dịch thuật
    • Trở thành đối tác
    • Dịch vụ dành cho Đối tác
    • Đăng ký công ty kế toán của bạn
    Nhận dịch vụ
    • Tìm đối tác
    • Tìm kế toán
    • Gặp chuyên gia hỗ trợ
    • Dịch vụ Triển khai
    • Khách hàng tham khảo
    • Hỗ trợ
    • Nâng cấp
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Nhận một buổi demo
  • Bảng giá
  • Trợ giúp

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

  • CRM
  • e-Commerce
  • Kế toán
  • Tồn kho
  • PoS
  • Dự án
  • MRP
All apps
Bạn cần phải đăng ký để tương tác với cộng đồng.
Tất cả bài viết Người Huy hiệu
Thẻ (Xem tất cả)
odoo accounting v14 pos v15
Về diễn đàn này
Bạn cần phải đăng ký để tương tác với cộng đồng.
Tất cả bài viết Người Huy hiệu
Thẻ (Xem tất cả)
odoo accounting v14 pos v15
Về diễn đàn này
Hỗ trợ

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

Đăng ký nhận tin

Nhận thông báo khi có hoạt động trên bài viết này

Câu hỏi này đã bị gắn cờ
javascriptv8webinheritancekanban
6 Trả lời
12487 Lượt xem
Ảnh đại diện
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
Ảnh đại diện
Huỷ bỏ
Ảnh đại diện
Mark Meadows
Câu trả lời hay nhất

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
Ảnh đại diện
Huỷ bỏ
Ảnh đại diện
Nicolas Bustillos
Câu trả lời hay nhất

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
Ảnh đại diện
Huỷ bỏ
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)

Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!

Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!

Đăng ký
Bài viết liên quan Trả lời Lượt xem Hoạt động
How do redeclare core js function in Odoo 11?
javascript web kanban odooV11
Ảnh đại diện
0
thg 11 19
3393
Change onclick kanban project view (JS file)
javascript inheritance
Ảnh đại diện
Ảnh đại diện
1
thg 3 22
7659
How to dont lost selected items in view (web addon)
javascript web
Ảnh đại diện
1
thg 8 16
5798
[javascript] Kanban view Đã xử lý
javascript kanban
Ảnh đại diện
2
thg 3 16
6127
How do i switch a view one time you call it from JavaScript.
javascript web
Ảnh đại diện
0
thg 3 15
5107
Cộng đồng
  • Khóa học
  • Tài liệu
  • Diễn đàn
Open source
  • Tải xuống
  • Github
  • Runbot
  • Dịch thuật
Dịch vụ
  • Lưu trữ Odoo.sh
  • Hỗ trợ
  • Nâng cấp
  • Phát triển tùy chỉnh
  • Đào tạo
  • Tìm kế toán
  • Tìm đối tác
  • Trở thành đối tác
Giới thiệu công ty
  • Công ty của chúng tôi
  • Tài sản thương hiệu
  • Liên hệ
  • Việc làm
  • Sự kiện
  • Podcast
  • Blog
  • Khách hàng
  • Pháp lý • Riêng tư
  • Bảo mật
الْعَرَبيّة 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 là bộ ứng dụng kinh doanh có open source đáp ứng tất cả các nhu cầu của công ty bạn: CRM, thương mại điện tử, kế toán, tồn kho, POS, quản lý dự án, v.v.

Định hướng giá trị riêng biệt của Odoo là tích hợp hoàn toàn và dễ dàng sử dụng.

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