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

HTML id of the Odoo fields

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
fieldsidhtmlodoo
3 Replies
6552 Tampilan
Avatar
Lukshala

When we inspect the Odoo field , we can see the HTML id of that. But it is changing from time to time. Is there any method to set that HTML id a constant ? Following is an example how it appears.

<label for="o_field_input_27" class="o_form_label c_label-9" style="width:30% !important;">
Phone
</label>

<input class="o_form_input c_field-63 o_form_field" id="o_field_input_27" type="text" style="width:25% !important;margin-right:7% !important">


0
Avatar
Buang
Sudhir Arya (ERP Harbor Consulting Services)

Would you please add more details?

Avatar
Lukshala
Penulis Jawaban Terbai

I am doing selenium automated testing ,for that I want to identify the  elements using its id . If i want to find elements like below then I can find that elements only using id . I don't want to find elements by xpath, since xpath can be changed when new fields are added. And also i would like to select elements without using class because there are some elements with same class.

<input class="o_form_input c_field-63 o_form_field" id="o_field_input_27" type="text" style="width:25% !important;margin-right:7% !important">

0
Avatar
Buang
Ravi Gadhia

In this case, you have two options

1) Add a unique class on each field you want to select during selenium test

<field name="partner_id" class="selenium_partner"/>

2) Patch the rendering engine and add new html `name` attribute on each field same as the field name

Note: The second option will break when form view has one2many field with an editable tree view and both contain same field name

Lukshala
Penulis

In first option, They already have classes, so cannot create another class for the same field.

<field name="company_id" class="c_field-65" required="1" options='{"no_open": True,"no_create":True }'/>

Can you please explain the second option in more detail please?

Ravi Gadhia

for the first option, if you add class from xml it will append the class so even though there is already existing class

anyway for the second option,

Form view rendered set unique label through `setIDForLabel` of abstract field

so in abstract file /addons/web/static/src/js/fields/abstract_field.js

add below line in `setIDForLabel` function

this.getFocusableElement().attr('name', this.name);

Lukshala
Penulis

Thanks Ravi Gadhia , Adding a new class helps (Y). Thanks alot for your Answer !!!!

Avatar
Ravi Gadhia
Jawaban Terbai

No, you can't it added by form view rendering engine.
what's your purpose to make id constant?

0
Avatar
Buang
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
Need to print content of html field
fields html
Avatar
Avatar
1
Mei 23
3125
How to use mass_mailing_html widget in custom html field odoo
html odoo
Avatar
0
Agu 21
2824
Possibility to add dynamic fields in Form view
fields form odoo
Avatar
Avatar
Avatar
2
Sep 23
10848
[odoo v16] How to Show image in tree view when there are no records? Diselesaikan
image html odoo
Avatar
Avatar
1
Mei 23
3582
What is difference between __last_update and write_date?
fields update odoo
Avatar
Avatar
1
Feb 22
8233
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