İç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

Clone a view with its modifications (extend res.partner)

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
viewsviewinheritanceres.partnerprogrammingcloneinheri
7587 Görünümler
Avatar
Javier Matos Odut

Hello,

I am a developer and I have created some modules for OpenERP v7 that we use in our company. I have a difficult problem that I want to solve and that's why I am willing someone to share some knowledge with me.

I have a module that extends res.partner to add many fields that we need for our customers. The problem with this is that there are many entities or models that depend on res.parther (res.user for instance). When I add fields to res.partner and extend the form view, then views or models that depend on res.partner are also modified, even when they have nothing to do with customers. This is ugly, because providers and users get those new fields, and I don't want that to happen.

A second approach was to use _inherits in order to control an inner partner, but also add the fields that I want:

_name = 'mycompany.customer'
_inherits = {
    'res.partner': 'partner_id',
}
_columns = {
    ...
}

This approach is cleaner. Now my customers have the basic information in res.partner, but I also add extra fields in my mycompany.customer model. The bad thing is that I have to write my own views from the scratch. What I do for this is to copy res.partner views and extend them. The worst part of this is that when an additional module changes res.partner view, then the view for my customer is not modified, so I have to copy the modifications that this module does into my own code.

What is the best way to do what I want? I just want new fields to be added to a customer, but not to a provider nor a user. I thought about adding a "clone" feature to OpenERP to clone views and its modifications. This way I will be able to clone res.partner views and make some changes to include customer fields.

1
Avatar
Vazgeç
Leonardo Donelli

Can't you just extend the form view normally (as you did initially) and make the fields invisible when the partner is not a customer?

Javier Matos Odut
Üretici

Thank you Leonardo, that is a good idea. How can I know when the partner is a customer? Can I just use domain with customer = 1? What I was trying now is to redefine the fields_view_get function, that is supposed to create a view dynamically. I will check your suggestion first, which seems to be easier. Thank you so much :)

Javier Matos Odut
Üretici

Done, thank you so much Leonardo :)

Leonardo Donelli

Yes you can use [('customer', '=', 1)] assuming you correctly flagged customers. Personally, I would add a tab in the res_partner form view notebook (called 'Customer info'), with all the customers-only fields, and show that only when partner is a customer.

Javier Matos Odut
Üretici

That is exactly what I had. There where also some minor changes that I made outside that customer notebook, but they were also hidden successfully. Thank you so much again, I was looking for an "Star Wars hiper-complex solution" doing meta programming to extend cloned views (with fields_view_get) but your proposal is just the easiest and most correct way to do it. Thank you again :)

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
attribute error in inherited view?
view inheritance res.partner
Avatar
Avatar
Avatar
2
Mar 15
9711
I want to use res_partner view to another menu action with fields (not all) in res_partner
views inheritance res.partner odoo
Avatar
Avatar
1
Kas 21
3998
inherited form does not display correctly?
view inheritance res.partner look
Avatar
Avatar
Avatar
3
Eki 20
6664
view inherit from res.partner appears all one page with no styling or formatting
view inheritance res.partner appearance
Avatar
Avatar
1
Mar 15
7459
custom_function is not a valid action on... Çözüldü
views view inheritance buttons odoo
Avatar
Avatar
1
Kas 22
7995
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