İç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 9: How to set display strings for boolean_button?

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
buttonstringboolean
7 Cevaplar
14086 Görünümler
Avatar
Matthew Watkins

Is there a way to set the text displayed in each state for a boolean button?

0
Avatar
Vazgeç
Avatar
Jérémy Kersten (jke)
En İyi Yanıt

not in the default code... but you can extend the widget your self...

by default:

    active: Active/Inactive

    archive: Active/Archive

    prod_environment: Product/Test

    by default : On/Off

via the option "terminology"

<field name="active" widget="boolean_button" options='{"terminology": "archive"}'/>




UPDATE:

 Here a sample of code to do it... https://github.com/odoo-dev/odoo/commit/e43ec89ec5e6a4e2cc43bad31e3452f130210acb

3
Avatar
Vazgeç
Matthew Watkins
Üretici

Thank you. This is great. Looks perfect. I will try it out ASAP.

Matthew Watkins
Üretici

Hi, I'm having a bit of difficulty using your example.

My code is:

odoo.define("custom_boolean_button.FieldBooleanButton", function (require) {

"use strict";

var form_widgets = require("web.form_widgets");

form_widgets.FieldBooleanButton.include({

init: function() {

this._super.apply(this, arguments);

switch (this.options["terminology"]) {

case "active":

this.string_true = _t("Active");

this.hover_true = _t("Deactivate");

this.string_false = _t("Inactive");

this.hover_false = _t("Activate");

break;

case "archive":

this.string_true = _t("Not Archived");

this.hover_true = _t("Archive");

this.string_false = _t("Archived");

this.hover_false = _t("Unarchive");

break;

case "custom":

if (this.options["terminology_values"]) {

var terms = this.options["terminology_values"];

this.string_true = _t(terms.string_true); this.hover_true = _t(terms.hover_true);

this.string_false = _t(terms.string_false);

this.hover_false = _t(terms.hover_false);

break;

}

default:

this.string_true = _t("On");

this.hover_true = _t("Switch Off");

this.string_false = _t("Off");

this.hover_false = _t("Switch On");

}

},

});

});

I get the error:

TypeError: Cannot read property 'include' of undefined

Avatar
Shreeram Yadav
En İyi Yanıt

You can simply add the options 

options="{'terminology':{

                'string_true': 'verify',

                'hover_true': 'verify',

                'string_false': 'Unverify',

                'hover_false': 'Unverify'

             }}"

Then It will display Verify/Unverify on button.

Eg.

<button name="toggle_verify" type="object" class="oe_stat_button test" icon="fa-check">

                      <field name="verify" widget="boolean_button" options="{'terminology':{

                'string_true': 'verify',

                'hover_true': 'verify',

                'string_false': 'Unverify',

                'hover_false': 'Unverify'

             }}"/>

                  </button>

2
Avatar
Vazgeç
Avatar
Jan Beckhoff
En İyi Yanıt

I used the solution provided by Jeremy and would just like to add that the terminology does not work if you have the field as a checkbox in the same view. The button will just display the checkbox. Remove the checkbox from the view and it works.

0
Avatar
Vazgeç
Avatar
Shameem Babu
En İyi Yanıt
<field name="your_boolean_field" nolabel="1"/>
<label attrs="{'invisible':[('your_boolean_field', '=', False)]}">
     Checked
</label>

<label attrs="{'invisible':[('Your_boolean_field','=',True)]}">

    Not Checked

</label>

0
Avatar
Vazgeç
Matthew Watkins
Üretici

Thanks for the reply. I'm sorry if I wasn't clear enough in my post. I'm actually looking for a way to change the strings displayed by the boolean_button widget. It has to be the widget because I'm using it to trigger a call to reload_on_button. I appreciate your reply, which would be otherwise totally workable.

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
How to change string of the button without altering its action
action button string
Avatar
Avatar
Avatar
2
Şub 23
4170
How to Display String on Boolean fields in XML
string boolean odooV8
Avatar
Avatar
2
Nis 19
10972
How to use Boolean_button on specific Field in Odoo 12 CC ? Çözüldü
community button boolean odoo12
Avatar
Avatar
1
May 19
7723
How to use boolean_button widget for a boolean field in wizard?
wizard widget button boolean
Avatar
0
Eki 16
19693
Opening new window with button in OpenERP Çözüldü
button
Avatar
Avatar
1
Oca 24
15157
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