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

Make readonly start_date, end_date from sale order view

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
viewsreadonlysale.order.form
2 Replies
1329 Tampilan
Avatar
Vikas Maharana

Hi All,

I want to make  start_date, end_date readonly from the sale order view.

so I tried the below approach.



I checked with other view id's and tried to make is readonly but it is not working.
please help on this.

0
Avatar
Buang
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Jawaban Terbai

Hi,


Try the following code.


<record id="sale_subscription_primary_form_view" model="ir.ui.view">

    <field name="name">sale.subscription.order.form.readonly</field>

    <field name="model">sale.order</field>

    <field name="inherit_id" ref="sale_subscription.sale_subscription_primary_form_view"/>

    <field name="arch" type="xml">

        <xpath expr="//field[@name='start_date']" position="attributes">

            <attribute name="readonly">1</attribute>

        </xpath>

        <xpath expr="//field[@name='end_date']" position="attributes">

            <attribute name="readonly">1</attribute>

        </xpath>

    </field>

</record>


In the enterprise add-on, there is another view that inherits from sale_subscription.sale_subscription_order_view_form and is set as the primary view.


Hope it helps

0
Avatar
Buang
Avatar
D Enterprise
Jawaban Terbai

Hi,

Here is update code so please try this 
<record id="sale_subscription_order_view_form_readonly" model="ir.ui.view">

    <field name="name">sale.subscription.order.form.readonly</field>

    <field name="model">sale.order</field>

    <field name="inherit_id" ref="sale_subscription.sale_subscription_order_view_form"/>

    <field name="arch" type="xml">

        <xpath expr="//field[@name='start_date']" position="attributes">

            <attribute name="readonly">1</attribute>

        </xpath>

        <xpath expr="//field[@name='end_date']" position="attributes">

            <attribute name="readonly">1</attribute>

        </xpath>

    </field>

</record>


Use xpath for reliability


other way to make filed readonly is :


<field name="start_date" readonly="1"/>

<field name="end_date" readonly="1"/>

it is make always readonly filed


I hope it is usefull

0
Avatar
Buang
Vikas Maharana
Penulis

in Odoo 18 we can do both path and using fields also.
I already tried this approach but it's no working

D Enterprise

Hii,
Check This:
Open a sale order in Odoo

Enable Developer Mode

Click the bug icon → "Edit View: Form"

Note the External ID — is it really sale_subscription.sale_subscription_order_view_form?

If not — you are patching the wrong view.
start_date and end_date are coming from another model
Use Developer Mode to check the field origin:

Hover over the field label → if it's a related field (e.g., from subscription_id.start_date), you must modify that model/view, or set readonly in the Python field definition.
Some view or module is overriding your change after yours loads
To rule this out:

Give your view a high sequence:
<field name="priority" eval="1000"/>

OR place it at the bottom of the data list in your __manifest__.py

Try This Final Setup (Full Example):

<record id="sale_order_start_end_readonly" model="ir.ui.view">
<field name="name">sale.order.readonly.start_end</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale_subscription.sale_subscription_order_view_form"/>
<field name="priority" eval="1000"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='start_date']" position="attributes">
<attribute name="readonly">1</attribute>
</xpath>
<xpath expr="//field[@name='end_date']" position="attributes">
<attribute name="readonly">1</attribute>
</xpath>
</field>
</record>
i hope it is usefull
Add this temporarily to verify:
<xpath expr="//field[@name='start_date']" position="replace">
<field name="start_date" readonly="1"/>
</xpath>

Vikas Maharana
Penulis

I did this, The external id is sale.view_order_form but there is no field called start_date and end_date.
so I check the inherited views and then find it is subscription module's view and tried to change the attribute but it is not working.
I did it using python field as well but don't know what wrong with this!

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
Make fields readonly based for certain groups which are having default groups Diselesaikan
readonly sale.order.form Groups
Avatar
Avatar
1
Nov 24
4258
Odoo 10 : Make a specific field of popup window only readable
views relationship readonly odoo10
Avatar
Avatar
Avatar
5
Mei 17
6264
[9.0c] Readonly m2o fields not opens in modal view like no readonly m2o
views readonly click 9.0c
Avatar
0
Apr 16
4239
Odoo Sales
readonly
Avatar
Avatar
1
Okt 24
7834
lock sales confirm
sale.order.form
Avatar
Avatar
1
Agu 24
1766
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