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
    • Discuss
    • 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

What is the recommended practice when updating models fieds ?

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
updateodooV8schemaORM
2 Replies
4227 Tampilan
Avatar
Paraita Wohler

We are using Odoo v8 and we'd like to improve the deployment of our in-house modules into production.

What are the good practices when upgrading custom modules ? At the moment we copy the latest version of the module into the addons folder, and trigger the update of the said module from the web interface (I do restart the server whenever it's required).

I forsee problems when I'm going to update existing (stored) fields in some of my models. I understand the Odoo ORM is going to create new storable fields but it doesn't have any clue if the new field comes from a renamed field or if it's a legit new field, so in the end we have to update our tables and move the values of the old field columns to the new field columns.

At the moment we tend to avoid modifying existing fields of our modules, as renaming those would make them appear empty on the user side (thank god Odoo doesn't drop non used columns).

With Hibernate (Java) it's possible to use different ddl strategies so the update of the schema is either the ORM's responsibility or the DBA's. Hibernate recommends the latter, because the update is more predictable. Is there a similar mechanism with Odoo ?

1
Avatar
Buang
Paraita Wohler
Penulis

up !

Avatar
Mohammed Rida Yahla
Jawaban Terbai

Hi,

When you get a new stored field after renaming the old one, you can pass the values from the old field to the new using a SQL commande in PGAdmin database (and after that you can drop the old if you want), in condition both of the new and old fields have compatible types (CHAR -> CHAR ...), otherwise you will have to use SQL converting functions.

For example let say you have a Char field named "description" in the model "My_model", and you want to rename it as "features":

To pass the old values from "description" column to the new "features", you have to run this sql query in postegres (PGAdmin):

update My_model set   features = description where features ='';

And by this you can merge the old values without losing the new ones.

Please Vote if you find my answer usefull.

1
Avatar
Buang
Paraita Wohler
Penulis

Thank you for your answer :) that's exactly what we are doing at the moment but as a control gate we'd like to prevent Odoo's ORM to "update" the database schema automatically so that changes like moving values from the old column to the new one become more explicit (which is good for maintainability). The trade-off in doing so is that we'd have to manually alter tables for Odoo's ORM to accomodate with its models, which can be acceptable in our case.

In the Java world, ORMs like Hibernate have such features (you can have a look at the hibernate.hbm2ddl.auto parameter in https://docs.jboss.org/hibernate/orm/5.0/manual/en-US/html/ch03.html). SQLAlchemy also have such feature through its Alembic tool.

Do you think there is a similar feature with Odoo ?

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
Why odoo want to delete some items when update all module ? Diselesaikan
update odooV8
Avatar
Avatar
10
Mei 20
9699
How to start server with --update all
update odooV8
Avatar
Avatar
1
Jan 16
7224
Developing new modules, KeyError: 'stock.picking' return self.models[model_name] Diselesaikan
module update odooV8
Avatar
Avatar
1
Jan 25
24619
updating module from command line error
update postgresql9.2 odooV8
Avatar
Avatar
1
Mei 21
6595
Odoo v8 still good for use?
update odooV8 odoo9.0
Avatar
Avatar
Avatar
Avatar
5
Jan 17
5271
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