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

v17: inherit VIEW , custom module code is not working...

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
viewinheritancecustommodulev17
1 Cevapla
4758 Görünümler
Avatar
SmithJohn45

created model to inherit res.users and added 'supervisor' field and i can see this field in pgAdmin and also in Settings ->Technical -> Fields

i am trying to add 'supervisor' in user's form, please check below 2 screenshots, what am i doing wrong here? the inherited Users form not showing my custom field 'supervisor' after partner_id ( Related Partner in below form ). note i have added view file name in manifest file, also added 'base' in manifest file, then start server with upgrade the module using -u custom_module -d db_17 



plesae help.

regards

0
Avatar
Vazgeç
Avatar
Ray Carnes (ray)
En İyi Yanıt

The field PARTNER_ID appears twice in the View you are inheriting.

Your field is being added after the FIRST occurrence, which will be hidden unless the User is archived and the Contact is not:

You want to add it after the SECOND occurrence.

See https://www.odoo.com/forum/help-1/select-multiple-elements-with-xpath-116090


You may be misunderstanding the Odoo data model - a User is a set of credentials and access rights - it is not an Employee.

The Employee App already has a Manager:




0
Avatar
Vazgeç
SmithJohn45
Üretici

thank you @Ray for reply.
yes, Manager is exist but the requirement is what i am trying to implement.

i have modified code (as per what i understand from link provided) but it is still not showing on user's form view, please check what i am missing or doing wrong here.

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Define a new view for inherited model -->
<record id="view_custom_res_user_form" model="ir.ui.view">
<field name="name">custom.res.users.form</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id'][1]" position="after">
<xpath expr="//field[@name='partner_id'][2]" position="after">
<field name="supervisor"/>
</xpath>
</xpath>
</field>
</record>
</odoo>

regards

SmithJohn45
Üretici

The error in Odoo.log file as below:

Error while parsing or validating view:

Element '<xpath expr="//field[@name=&#39;partner_id&#39;][2]">' cannot be located in parent view

View error context:
{'file': 'd:\\program files\\odoo '
'17.0.20240101\\server\\odoo\\custom_addons\\brb_customizations\\views\\res_users_view.xml',
'line': 2,
'name': 'custom.res.users.form',
'view': ir.ui.view(1338,),
'view.model': 'res.users',
'view.parent': ir.ui.view(162,),
'xmlid': 'view_custom_res_user_form'}

.

SmithJohn45
Üretici

sorry @Ray, by mistake i posted above error in Odoo.log please ignore it, it was because of before my posted code in your reply.

SmithJohn45
Üretici

my first Comment to your Answer is valid, the 2nd one in which i posted error in Odoo.log is not.
waiting for your reply on my first Comment.
regards

Ray Carnes (ray)

In your first comment, you have an xpath inside an xpath and this is not supported.

If you wish to place your field after the second partner_id just reference the second partner_id - you don't need to reference the first at all

SmithJohn45
Üretici

@Ray
i have check with code below, its not even start Odoo Server and showing errors in odoo.log file as below:
-------
Element '<xpath expr="//field[@name=&#39;partner_id&#39;][2]">' cannot be located in parent view

View error context:
{'file': 'd:\\program files\\odoo '
'17.0.20240101\\server\\odoo\\custom_addons\\brb_customizations\\views\\res_users_view.xml',
'line': 3,
'name': 'custom.res.users.form',
'view': ir.ui.view(1338,),
'view.model': 'res.users',
'view.parent': ir.ui.view(162,),
'xmlid': 'view_custom_res_user_form'}
--------

modified code as per your instruction:

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Define a new view for inherited model -->
<record id="view_custom_res_user_form" model="ir.ui.view">
<field name="name">custom.res.users.form</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id'][2]" position="after">
<field name="supervisor"/>
</xpath>
</field>
</record>
</odoo>

please advice and help.
regards

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
Customizing the save manually button Çözüldü
inheritance v17
Avatar
Avatar
Avatar
2
Eki 24
3457
How to change the button display name via inherit Çözüldü
inheritance v17
Avatar
Avatar
2
Haz 24
2354
v17: while installing on Live it throws error The module cannot be downloaded
custommodule v17
Avatar
0
Oca 24
2533
View inheritance Çözüldü
view inheritance
Avatar
Avatar
1
Mar 20
4344
How do I remove fields from a view in a custom module? Çözüldü
view inheritance
Avatar
Avatar
Avatar
Avatar
12
Ara 18
36177
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