Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Diskusi
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

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

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

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

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
javascriptv8webinheritancekanban
6 Replies
12485 Tampilan
Avatar
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
Avatar
Buang
Avatar
Mark Meadows
Jawaban Terbai

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
Avatar
Buang
Avatar
Nicolas Bustillos
Jawaban Terbai

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
Avatar
Buang
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)

Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
How do redeclare core js function in Odoo 11?
javascript web kanban odooV11
Avatar
0
Nov 19
3391
Change onclick kanban project view (JS file)
javascript inheritance
Avatar
Avatar
1
Mar 22
7659
How to dont lost selected items in view (web addon)
javascript web
Avatar
1
Agu 16
5796
[javascript] Kanban view Diselesaikan
javascript kanban
Avatar
2
Mar 16
6122
How do i switch a view one time you call it from JavaScript.
javascript web
Avatar
0
Mar 15
5106
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة 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 adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik 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