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

Xpath works locally but won't work when deployed on server.

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
inheritancedeploymentxpathodoov12
8 Cevaplar
6745 Görünümler
Avatar
Sameer Ahmad

I have a piece of code like below

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="report_invoice_document">
<t t-call="web.external_layout">
<t t-set="o" t-value="o.with_context(lang=lang)" />
<t t-set="address">
<address t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}' />
<div t-if="o.partner_id.vat" class="mt16"><t t-esc="o.company_id.country_id.vat_label or 'Tax ID'"/>: <span t-field="o.partner_id.vat"/></div>
</t>
<div class="page">
<div id="informations" class="row mt32 mb32">
<div class="col-auto mw-100 mb-2" t-if="o.name" name="description">
<strong>Description:</strong>
<p class="m-0" t-field="o.name"/>
</div>
</div>
</div>
</t>
</template>
</data>
</odoo>

I want to inherit and replace the informations div so i inherit the code like below using xpath

<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<template id="report_invoice_document_inherit" inherit_id="account.report_invoice_document">
<xpath expr="//div[@id='informations']" position="replace">
<div id="informations" class="row mt32 mb32">
<div class="col-auto mw-100 mb-2" t-if="o.date_invoice" name="invoice_date">
<strong>Invoice Date:</strong>
<p class="m-0" t-field="o.date_invoice"/>
</div>
</div>
</xpath>
</template>
</data>
</odoo>

The problem is, the above code and the xpath works fine when i test it in my local machine but it throws me an error as below when i deploy it to a server

Element '<xpath expr="//div[@id='informations']">' cannot be located in parent view

I have checked community code in server and everything seems to be fine. I want to know is there anything wrong in my code? or is it related to the xpath? What seems to cause the issue? Any help?

0
Avatar
Vazgeç
Niyas Raphy (Walnut Software Solutions)

Also make sure that the corresponding div you have used in the xpath is not replaced or removed from the inheriting in any other custom module in the server.

Sameer Ahmad
Üretici

will make sure, thank you!

Avatar
Sudhir Arya (ERP Harbor Consulting Services)
En İyi Yanıt

Hi Sameer,

Make sure the account module has same structure as per your xpath in your server.

This is a common reason that something works on our local system but not on the server because server might have older version of odoo and we use latest version in our local system.

Just double check the report file of account module with your local system and with the server.

2
Avatar
Vazgeç
Sameer Ahmad
Üretici

Hi Sudhir,

The first thing i checked for is the thing you mentioned and the account module is same in my local machine and in the server. It makes sense cause we use our own tfs server so no chance of difference will arise and when i checked the files are same. So now i don't know what's causing the issue. Have you ever faced something like this?

Sudhir Arya (ERP Harbor Consulting Services)

Double check with the inherited views. There might be the case that any module would be replacing that div you are using in xpath.

Sameer Ahmad
Üretici

Yes Sudhir. Got an idea now as to why the issue occured. Thanks for your input.

Avatar
Ermin Trevisan
En İyi Yanıt

You may have different settings or options set in your production server which leads to such a situation.

Check your parent view under "Settings/Technical/User Interface/Views".

1
Avatar
Vazgeç
Sameer Ahmad
Üretici

Hi Ermin,

Thanks for your input. I'll look into it and update.

Sameer Ahmad
Üretici

I don't know how or why but the odoo community file code and the code in odoo UI was different, when i copy and pasted the community code into the UI as well the problem got solved. The question now is how did the code get changed in the odoo UI?

Avatar
Nikhil Dhiman
En İyi Yanıt

Hello, I also faced the same issue... There is a module named sale_layout in odoo 12 community version.. which inherits "report_invoice_document".. you need to inherit the id of that template & then replace the field with your xpath... hope it works for you...

0
Avatar
Vazgeç
Sameer Ahmad
Üretici

Hi Nikhil,

I don't have sale related modules installed but anyway let me check and update you. Btw the issue is resolved when I replaced the code in report_invoice_document in odoo ui to the code which is in report_invoice file. As Ermin said it. The issue is cleared but I'm waiting for someone to explain me why did it occur in the first place. As Niyas said and as per your answer I think I got an idea why it occurred. Let me cross check and update you soon though. Thanks for the input.

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 to modify xpath from other xpath? (inherit from inherited view) Çözüldü
inheritance xpath
Avatar
Avatar
Avatar
4
Ara 23
19717
Problem with XPATH
inheritance xpath v15
Avatar
Avatar
1
Tem 25
3138
Extension View - Multiple xpath replacements Çözüldü
views inheritance xpath
Avatar
Avatar
Avatar
2
May 24
4194
Vista no disponible fleet.vehicle.inspection.control_panel.custom definición en fleet_vehicle_inspection_ecom/views/fleet_vehicle_inspection_ecom.xml
inheritance xpath v15
Avatar
Avatar
1
Şub 24
2282
How to hide a button that is identified by its action id ?
views inheritance xpath
Avatar
Avatar
Avatar
4
Eyl 20
7236
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