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

Element '<field name="invoice_policy">' cannot be located in parent view

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
fieldsxmlproduct.productposition
1 Cevapla
3916 Görünümler
Avatar
random_mai

 I want to move the fields to a different notebook (or tab) in the view and hide the company field: invoice_policy (Invoice Policy), tic_category_id (TaxCloud Category), company_id (Company). However, I encountered an error, this is applicable to the fields mentions:

When i use "position=replace" the fields:

Element '' cannot be located in parent view

When i call the fields again to their new position:

Field "tic_category_id" does not exist in model "product.product"


Here's my code, i am inheriting the form view in Inventory module:




<record id="view_product" model="ir\.ui\.view\"\>


\ \ \ \ \ \ \ \ \<field\ name=\"name\"\>custom.product.product.form.inherit</field>


       <field name="model">product.product</field>


        <field name="priority" eval="6"/>


        <field name="inherit_id" ref="product.product_normal_form_view" />


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


            <!-- When i do this i don’t encounter an error —>


            <field name="barcode" position="replace"/>


            <!-- When i do this i encounter an error an error —>


            <field name="invoice_policy" position="replace"/>


            <group name="group_general" position="inside">


                <!— No error here whenever i call the field —>


                <field name="barcode"/>


                <!— Error when calling again the invoice_policy, saying that it does not exist in product.product —>


                <field name="invoice_policy"/>


            </group>           


        </field>


    </record>



I'm not sure why these 3 fields are experiencing an error and why i can't use the field again. As much as possible i don't want to use xpath. Although, i tried xpath, i still encountered the error above.


Please help. Thank you so much


0
Avatar
Vazgeç
shubham shiroya

You can visible the invisible field
field name="field_name" invisible="0"/>

Avatar
shubham shiroya
En İyi Yanıt

The error you're encountering when using position="replace" or calling the fields again in a different position is likely due to the fact that these fields are defined within a notebook (page or notebook) in the original view, and you're trying to replace or move them outside of that notebook.

To overcome this issue and move the fields to a different notebook or tab while hiding the company_id field, you can use the following approach:

record id="view_product" model=" rel="ugc">ir.ui.view">
fieldname="name">custom.product.product.form.inherit
field name="model">product.product
field name="priority" eval="6"/>
field name="inherit_id" ref="product.product_normal_form_view" />
field name="arch" type="xml">
data>
!-- Find the notebook/page where the fields are defined -->

xpath expr="//notebook/page[@name='page_general_information']" position="inside">
!-- Remove the company_id field -->
field name="company_id" position="replace">
field name="company_id" invisible="1"/>
/field>
-- Move the fields to a different notebook or tab -->
page string="Custom Tab">
group>
field name="invoice_policy"/>
field name="tic_category_id"/>
/group>
/page>
/xpath>
/data>
/field>
/record>

In the above code, we use an XPath expression to find the notebook (page_general_information) where the fields are defined. Then, we remove the company_id field by replacing it with a hidden version of itself ().

Next, we create a new page (or notebook tab) called "Custom Tab" and move the desired fields (invoice_policy and tic_category_id) inside this new page using the tag.

1
Avatar
Vazgeç
random_mai
Üretici

I'm still getting an error. For company id -> ERR: Cannot read properties of undefined (reading 'company_id')

And for moving the invoice_policy and tic_category_id -> ERR: Field "invoice_policy" does not exist in model "product.product"

shubham shiroya

he invoice_policy and tic_category_id fields might be defined in related models or inherited models.
To resolve these errors and successfully move or hide the fields, you need to find the correct model where these fields are defined and update your code accordingly. Here's an example of how you can modify the code:

record id="view_product" model="ir.ui.view">
field name="name">custom.product.product.form.inherit</field>
field name="model">product.template</field>
field name="priority" eval="6"/>
field name="inherit_id" ref="product.product_template_only_form_view"/>
field name="arch" type="xml">
xpath expr="//page[@name='general_information']" position="inside">
field name="barcode" position="replace"/>
/xpath>
xpath expr="//page[@name='general_information']/group[@name='general_info_group']" position="inside">
field name="invoice_policy" position="replace"/>
field name="tic_category_id" position="replace"/>
/xpath>
/field>
/record>

In this modified code:

The model field is changed to product.template to match the correct model where the fields are defined.

The inherit_id is set to product.product_template_only_form_view to inherit the form view specific to the product.template model.

The <xpath> expressions are adjusted to target the correct locations within the view hierarchy, considering the new model and view.

random_mai
Üretici

sorry, now i'm getting this error -> Field "invoice_policy" does not exist in model "product.template"

apparently it still doesn't exist. this is odoo16v if it helps

shubham shiroya

model in Odoo 16, you can use the following approach:
record id="view_product_template_form" model="ir.ui.view">
field name="name">custom.product.template.form.inherit</field>
field name="model">product.template</field>
field name="inherit_id" ref="product.product_template_only_form_view"/>
field name="arch" type="xml">
xpath expr="//field[@name='barcode']" position="replace">
!-- Your modified barcode field -->
/xpath>
xpath expr="//field[@name='tic_category_id']" position="replace">
<!-- Your modified tic_category_id field -->
/xpath>
xpath expr="//field[@name='company_id']" position="attributes">
attribute name="invisible">1</attribute>
/xpath>
/field>
/record>
In this example, I have assumed that the barcode and tic_category_id fields exist in the product.template model. You can modify the code inside the <xpath> tags to define the modifications you want to make to these fields.

Make sure to update the model attribute in the <record> tag to match the target model for your customization.

random_mai
Üretici

the fields are now hidden, thank you for that. however, i still can't use invoice_policy and tic_category_id

random_mai
Üretici

Can i use xpath to show the field?

shubham shiroya

yes,you can

random_mai
Üretici

how can i use xpath to show the invisible field?

random_mai
Üretici

<style type="text/css">
p.p1 {
margin: 0.0px 0.0px 0.0px 0.0px;
font: 13.0px 'Helvetica Neue'
}

p.p2 {
margin: 0.0px 0.0px 0.0px 0.0px;
font: 13.0px 'Helvetica Neue';
min-height: 15.0px
}
</style>
<style type="text/css">
p.p1 {
margin: 0.0px 0.0px 0.0px 0.0px;
font: 11.0px 'Helvetica Neue'
}

p.p2 {
margin: 0.0px 0.0px 0.0px 0.0px;
font: 11.0px 'Helvetica Neue';
min-height: 12.0px
}
</style>
<style type="text/css">
p.p1 {
margin: 0.0px 0.0px 0.0px 0.0px;
font: 13.0px 'Helvetica Neue'
}

p.p2 {
margin: 0.0px 0.0px 0.0px 0.0px;
font: 11.0px 'Helvetica Neue';
min-height: 12.0px
}

p.p3 {
margin: 0.0px 0.0px 0.0px 0.0px;
font: 11.0px 'Helvetica Neue'
}
</style>
<p>&nbsp;&lt;xpath expr=&quot;//field[@name=&apos;invoice_policy&apos;]&quot; position=&quot;attributes&quot;&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;attribute name=&quot;invisible&quot;&gt;0&lt;/attribute&gt;</p>
<p>&lt;/xpath&gt;</p>

This code doesn't display the invoice_policy

random_mai
Üretici

i need to use xpath instead of field since i am having an error that the field doesnt exist

shubham shiroya

xpath expr="//field[@name='invoice_policy']" position="attributes">
attribute name="invisible">0</attribute>
/xpath>

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
How make the values of a field dissappear in QWEB report?
xml product.product
Avatar
Avatar
1
May 20
2694
Pass field value to iframe src Çözüldü
fields xml iframe
Avatar
Avatar
Avatar
2
Ağu 22
8674
Is it possible to use fa-icons in field string?
fields xml string v14
Avatar
Avatar
1
Şub 24
2454
View displays duplicate fields despite setting it as invisible Çözüldü
field product.product position odoo16features
Avatar
Avatar
Avatar
2
Haz 23
3325
Calling res.partner field in pos receipt
javascript fields xml odoo10
Avatar
Avatar
1
Haz 23
4504
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