İçereği Atla
Odoo Menü
  • Portal
  • Ücretsiz deneyin
  • Uygulamalar
    Finans
    • Muhasebe
    • Faturalama
    • Masraf Yönetimi
    • Elektronik Çizelge (BI)
    • Belgeler
    • İmza
    Satış
    • Müşteri İlişkileri Yönetimi (CRM)
    • Satış
    • Satış Noktası Mağaza
    • Satış Noktası Restoran
    • Abonelikler
    • Kiralama
    Web Sitesi
    • Web Sitesi Oluşturucu
    • eTicaret
    • Blog
    • Forum
    • Canlı Sohbet
    • eÖğrenme
    Tedarik Zinciri
    • Envanter
    • Üretim
    • Ürün Yaşam Döngüsü Yönetimi
    • Satın Alma
    • Bakım
    • Kalite
    İnsan Kaynakları
    • Çalışanlar
    • İşe Alım
    • İzin
    • Değerlendirme
    • Referans
    • Filo Yönetimi
    Pazarlama
    • Sosyal Medyada Pazarlama
    • E-posta ile Pazarlama
    • SMS ile Pazarlama
    • Etkinlikler
    • Pazarlama Otomasyonu
    • Anket
    Hizmetler
    • Proje Yönetimi
    • Çalışma Çizelgeleri
    • Saha Hizmeti
    • Yardım Masası
    • Planlama
    • Randevular
    Verimlilik
    • Sohbet
    • Onay
    • Nesnelerin İnterneti
    • VoIP
    • Bilgi Bankası
    • WhatsApp
    Üçüncü taraf uygulamalar Odoo Stüdyo Odoo Bulut Platformu
  • Sektörler
    Perakende satış
    • Kitapçı
    • Giyim Mağazası
    • Mobilya Mağazası
    • Gıda Marketi
    • Hırdavat Dükkanı
    • Oyuncak Dükkanı
    Gıda ve Konaklama
    • Bar ve Pub
    • Restoran
    • Fast Food Restoranı
    • Konuk Evi
    • İçecek Distribütörü
    • Otel
    Gayrimenkul
    • Emlak Acentesi
    • Mimarlık Firması
    • İnşaat
    • Emlak Yönetimi
    • Bahçe Tasarımı
    • Mülk Sahipleri Derneği
    Uzmanlık
    • Muhasebe Firması
    • Odoo Partner
    • Pazarlama Ajansı
    • Hukuk Firması
    • Yetenek Kazanımı
    • Denetim ve Belgelendirme
    Üretim
    • Tekstil
    • Metal
    • Mobilyalar
    • Gıda
    • Bira fabrikası
    • Kurumsal Hediye
    Sağlık ve Spor
    • Spor Kulübü
    • Optik Mağazası
    • Fitness Merkezi
    • Sağlıklı Yaşam Merkezi
    • Eczane
    • Kuaför Salonu
    Ticaret
    • Tamirci
    • BT Donanım & Destek
    • Güneş Enerjisi Sistemleri
    • Ayakkabı İmalatçısı
    • Temizlik Hizmetleri
    • HVAC Hizmetleri
    Diğerleri
    • Kar Amacı Gütmeyen Kuruluş
    • Çevre Ajansı
    • Reklam Panosu Kiralama
    • Fotoğrafçılık
    • Bisiklet Kiralama
    • Yazılım Bayisi
    Tüm Sektörlere Göz Atın
  • Topluluk
    Öğrenim
    • Eğitim Araçları
    • Dokümantasyon
    • Sertifikasyonlar
    • Eğitim Etkinlikleri
    • Blog
    • Podcast
    Eğitim ve Gelişim
    • Eğitim Programı
    • Scale Up! İşletme Oyunu
    • Odoo'yu Ziyaret Edin
    Yazılım
    • İndirin
    • Sürümleri Kıyaslayın
    • Sürümler
    İş Birliği
    • Github
    • Forum
    • Etkinlikler
    • Çeviriler
    • Partner Olun
    • Partnerler için Hizmetler
    • Muhasebe Firmanızı Kaydettirin
    Hizmetler
    • Partner Bulun
    • Muhasebeci Bulun
    • Bir danışmanla görüşün
    • Kurulum Hizmetleri
    • Müşteri Referansları
    • Destek
    • Sürüm Yükseltme
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Demo randevusu alın
  • Fiyatlandırma
  • Yardım

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

  • Müşteri İlişkileri Yönetimi
  • e-Commerce
  • Muhasebe
  • Envanter
  • PoS
  • Proje Yönetimi
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
Yardım

Odoo 16 - How to add a button next to Create/Export in List View and Kanban View

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
javascriptxmlemployeebuttonmanifest
3 Cevaplar
8584 Görünümler
Avatar
Marco Duran

In Odoo 12, 14 and 15 I have created a button next to Create/Export in List View and Kanban View, it renders and perform an action without any problem. But in Odoo 16 I am having an issue that the button is not rendering in both views.

Example List View Odoo 15:


My code is looks like this in Odoo 15:

Manifest:

"assets": {

    "web.assets_backend": [

        "/proyect_name/static/src/js/hr_list_view.js"

    ],

    'web.assets_qweb': [

        '/proyect_name/static/src/xml/hr_list_view.xml'

    ]

}


XML:

<templatesxml:space="preserve">    

    <tt-extend="ListView.buttons">

        <tt-jquery="button.o_list_export_xlsx"t-operation="after">

            <tt-if="widget.is_action_enabled('export_xlsx') and widget.isExportEnable">                                  <buttonid="list_view_test" t-if="widget.modelName == 'hr.employee'"type="button"class="btn btn-secondary oe_export_test o_list_export_xlsx open_wizard_action_kanban oe_highlight">Testbutton>

            t>

        t>

    t>

templates>


Javascript:

odoo.define('export_ins.print_ins', function (require) {

    "use strict";

    var ListController = require('web.ListController');

    var rpc = require('web.rpc'); 

    ListController.include({

        renderButtons: function ($node) {

            this._super.apply(this, arguments);

            if (this.modelName === "hr.employee" && this.$buttons) {

                this.$buttons.find('.oe_export_test').click(this.proxy('action_def'));  

            }

        },

        action_def: function (ev) {

            varself = this;

            returnrpc.query({model:'hr.employee', method:'odoo_button_click_test'

            },{

                shadow:true

            }).then(function (res) {

                returnself.do_action(res)

            }).catch(function (error) {

                console.log(this, error.message.data.message);

            });

        },

    });

});


How can I perform the same rendering and action but in Odoo 16?


Thanks for the response!

1
Avatar
Vazgeç
Avatar
Rama Altayeb
En İyi Yanıt

For odoo16 Follow this tutorial 

www.cybrosys.com/blog/how-to-add-a-create-button-near-tree-kanban-view-in-odoo-15

But put your xml and js files in assets_backend bundle
and then change o_list_button_button to o_list_button_add


 

<t t-extend="ListView.buttons" t-name="some_unique_name">
        <t t-jquery="button.o_list_button_add" t-operation="after">
            <button type="button" class="btn btn-primary open_wizard_action">
                    Open Wizard
            </button>
        </t>
    </t>


       
           
       
   

1
Avatar
Vazgeç
Rama Altayeb

https://www.cybrosys.com/blog/how-to-add-a-create-button-near-tree-kanban-view-in-odoo-15

Avatar
Mehjabin Farsana
En İyi Yanıt

Hi,
In Odoo 16 the qweb templates are loaded in the assets_backend. We don't have web.assets_qweb in 16.
Try by removing the assets_qweb and add the path in the assets_backend.


"assets": {
"web.assets_backend": [
"/proyect_name/static/src/js/hr_list_view.js",
'/proyect_name/static/src/xml/hr_list_view.xml'
],
}


Hope this will help you

Thank you

1
Avatar
Vazgeç
Marco Duran
Üretici

Hello,
Thanks for the fast response.

I changed the paths to web.assets_backend but still without success, and in the browse console I am getting this message: "Views: using legacy view: qweb" and "Views: using legacy view: activity" (I don't know if it's because of my code) although I removed web.assets_qweb and changed to web.assets_backend. And at this point I don't what could be the problem.

Regards!

Avatar
Ashish Hirpara
En İyi Yanıt

Here is the complete code for creating a button in Odoo 16 List View and Kanban View:

Manifest:

"assets": {

"web.assets_backend": [

    "/proyect_name/static/src/js/hr_list_view.js"

],

'web.assets_qweb': [

    '/proyect_name/static/src/xml/hr_list_view.xml'

]

}

XML:

"ListView.buttons">

    "button.o_list_export_xlsx" t-operation="after">

        if="widget.is_action_enabled('export_xlsx') and widget.isExportEnable">                                  

templates>

Javascript:

odoo.define('export_ins.print_ins', function (require) {

use strict"; var ListController = require('web.ListController'); var rpc = require('web.rpc'); ListController.include({ renderButtons: function ($node) { this._super.apply(this, arguments); if (this.modelName === "hr.employee" && this.$buttons) { this.$buttons.find('.oe_export_test').click(this.proxy('action_def')); } }, action_def: function (ev) { var self = this; return rpc.query({model:'hr.employee', method:'odoo_button_click_test' },{ shadow:true }).then(function (res) { return self.do_action(res) }).catch(function (error) {...........

0
Avatar
Vazgeç
Marco Duran
Üretici

Hi Ashish. I don't know if you mistakely copy the wrong code? It is because the code is like I shared for the question, or is there any difference?

Thanks for the response and help!

Regards

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Üye Ol
İlgili Gönderiler Cevaplar Görünümler Aktivite
Crash while using useService : TypeError: right-hand side of 'in' should be an object, got undefined
javascript manifest
Avatar
1
May 24
3489
Get data from JS file to XML file Çözüldü
javascript xml
Avatar
Avatar
1
Ağu 20
9932
Comparing javascript varriable with t-if
javascript xml
Avatar
Avatar
Avatar
2
Haz 20
5062
how shall I put a button in the center of its line? Çözüldü
xml button
Avatar
Avatar
Avatar
2
Tem 19
9908
How do create a button using xml and its action in the JavaScript in Odoo 10 ?
javascript button
Avatar
Avatar
1
Tem 17
3926
Topluluk
  • Eğitim Araçları
  • Dokümantasyon
  • Forum
Açık Kaynak
  • İndirin
  • Github
  • Runbot
  • Çeviriler
Hizmetler
  • Odoo.sh Hosting
  • Destek
  • Sürüm Yükseltme
  • Özel Geliştirmeler
  • Eğitim
  • Muhasebeci Bulun
  • Partner Bulun
  • Partner Olun
Hakkında
  • Şirketimiz
  • Pazarlama Gereçleri
  • İletişim
  • Kariyer
  • Etkinlikler
  • Podcast
  • Blog
  • Müşteriler
  • Hukuki • Gizlilik
  • Güvenlik
الْعَرَبيّة 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, müşteri ilişkileri yönetimi, eTicaret, muhasebe, envanter, satış noktası, proje yönetimi gibi şirketinizin tüm ihtiyaçlarını karşılayan bir açık kaynak işletme uygulamaları paketidir.

Odoo’nun eşsiz değer önermesi, aynı anda hem kullanımının çok kolay olup hem de tamamen entegre olmasıdır.

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