İç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
    • Yapay Zeka
    • 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
Toplulukla etkileşime geçmek için kayıtlı olmanız gerekir.
Tüm Gönderiler İnsanlar Rozetler
Etiketler (Tümünü göster)
odoo accounting v14 pos v15
Bu forum hakkında
Toplulukla etkileşime geçmek için kayıtlı olmanız gerekir.
Tüm Gönderiler İnsanlar Rozetler
Etiketler (Tümünü göster)
odoo accounting v14 pos v15
Bu forum hakkında
Yardım

Modifying Purchase Order Report - Odoo Online

Abone Ol

Bu gönderide etkinlik olduğunda bildirim alın

Bu soru işaretlendi
inheritancereportspurchase_order
2 Cevaplar
861 Görünümler
Avatar
Lulu Pintado
I am trying to apply modifications to my purchase order report through inherited view. I am trying to moify the format of the shipping address (the information_block section in the screenshot below). 

This is the snippet of the architecture of the base view (I'm only including the part I am trying to modify):


<t t-name="purchase.report_purchaseorder_document">
    <t t-call="web.external_layout">
        <t t-set="o" t-value="o.with_context(lang=o.partner_id.lang)"/>
        <t t-set="address">
            <div t-field="o.partner_id" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;, &quot;phone&quot;, &quot;vat&quot;], &quot;no_marker&quot;: True, &quot;phone_icons&quot;: True}"/>
        </t>
        <t t-if="o.dest_address_id">
            <t t-set="information_block">
                <strong class="d-block mt-3">Shipping address</strong>
                <div t-if="o.dest_address_id">
                    <div t-field="o.dest_address_id" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;, &quot;phone&quot;], &quot;no_marker&quot;: True, &quot;phone_icons&quot;: True}" name="purchase_shipping_address"/>
                </div>

            </t>



View: report_purchaseorder_document


I have tried different syntax and the shipping address remains unchanged. How can I replace the information_block for this report? I believe the if statements its whats causing my issue - I do not think I am handling them properly. 


These are the sytanx I have used: 


Attempt 1:

<data>
  <data>
    <xpath expr="//t[@t-set='information_block']" position="replace">
      <t t-set="information_block">
        <strong>Shipping Address</strong><br/>
        <div t-field="o.dest_address_id" 
             t-options="{'widget': 'contact', 'fields': ['name', 'address', 'phone'], 'no_marker': True}"/>
      </t>
    </xpath>
  </data>

</data>

Attempt 2:


<data>
  <data>
    <xpath expr="//t[@t-if='o.dest_address_id']/t[@t-set='information_block']" position="replace">
      <t t-set="information_block">
        <strong>Shipping Address</strong><br/>
        <div t-field="o.dest_address_id" 
             t-options="{'widget': 'contact', 'fields': ['name', 'address', 'phone'], 'no_marker': True}"/>
      </t>
    </xpath>
  </data>

</data>

I hope i am making sense. Please ask any clarifying questions. Thanks! 

0
Avatar
Vazgeç
Avatar
Cybrosys Techno Solutions Pvt.Ltd
En İyi Yanıt

Hi,

The issue you are encountering is likely due to how the t-if condition wraps the information_block. When targeting only the t-set node, the condition can prevent the replacement from being applied as expected.

You can try the following approach, which replaces the entire t-if block:

<xpath expr="//t[@t-if='o.dest_address_id']" position="replace">
    <t t-if="o.dest_address_id">
        <t t-set="information_block">
            <strong>Shipping Address:</strong><br/>
            <div t-field="o.dest_address_id"
                 t-options="{'widget': 'contact', 'fields': ['name', 'address', 'phone'], 'no_marker': True}"/>
        </t>
    </t>
</xpath>

This ensures that the full conditional structure is overridden correctly.

Alternatively, if your goal is only to modify the shipping address format (without affecting the surrounding logic), you can directly target the specific block inside the template:

<xpath expr="//div[@name='purchase_shipping_address']" position="replace">
    <div t-field="o.dest_address_id"
         t-options="{'widget': 'contact', 'fields': ['name', 'address', 'phone'], 'no_marker': True}"/>
</xpath>

This second approach, avoids modifying the conditional logic and focuses only on the display format.


Hope it helps

0
Avatar
Vazgeç
Avatar
Zehntech Technologies Inc.
En İyi Yanıt

Hello, 

You're on the right track this issue typically comes from how the t-set is wrapped inside a t-if, which makes the XPath a bit sensitive.

In this case, instead of targeting only t-set="information_block", you should target it within its parent condition, ensuring the full structure is correctly matched.

You can try a more precise XPath like this:

<xpath expr="//t[@t-if='o.dest_address_id']//t[@t-set='information_block']" position="replace">

<t t-set="information_block">

<strong>Shipping Address</strong><br/>

<div t-field="o.dest_address_id"

t-options="{'widget': 'contact', 'fields': ['name', 'address', 'phone'], 'no_marker': True}"/>

</t>

</xpath>

Also, make sure that:

  • Your inherited view is correctly linked to report_purchaseorder_document
  • The module is upgraded and cache is cleared (especially on Odoo Online, changes may take a moment)

If it still doesn’t apply, another reliable approach is to replace the parent t-if block entirely and redefine your structure.

Hope this works for you! If you need any help implementing this or want a more optimized approach, feel free to reach out for further discussion

Regards,

Zehntech Technologies Inc.

santosh.sekwadia@zehntech.com

-1
Avatar
Vazgeç
Tartışma hoşunuza mı gidiyor? Sadece okumakla kalmayın, katılın!

Özel özelliklerden yararlanmak ve harika topluluğumuzla etkileşime geçmek için bugün bir hesap oluşturun!

Üye Ol
İlgili Gönderiler Cevaplar Görünümler Aktivite
RfQ/PO don't use supplier or manufacturer product name/nr
reports purchase_order
Avatar
1
Nis 26
4052
Loading for forever on clicking on save button.
inheritance purchase_order loading
Avatar
Avatar
1
Tem 23
3743
Purchase order READONLY_STATES inherit
inheritance purchase_order odoo9
Avatar
Avatar
1
Tem 23
6342
Modify report template request for quotation and order
templates reports purchase_order
Avatar
0
Ara 23
6125
'order' object has no attribute '_line_no' while making custom reports
rml reports purchase_order
Avatar
0
Mar 15
4256
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 Svenska ภาษาไทย 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