Zum Inhalt springen
Odoo Menü
  • Anmelden
  • Jetzt gratis testen
  • Apps
    Finanzen
    • Buchhaltung
    • Rechnungsstellung
    • Spesenabrechnung
    • Tabellenkalkulation (BI)
    • Dokumente
    • E-Signatur
    Verkauf
    • CRM
    • Verkauf
    • Kassensystem – Shop
    • Kassensystem – Restaurant
    • Abonnements
    • Vermietung
    Websites
    • Website-Builder
    • E-Commerce
    • Blog
    • Forum
    • Livechat
    • E-Learning
    Lieferkette
    • Lager
    • Fertigung
    • PLM
    • Einkauf
    • Wartung
    • Qualität
    Personalwesen
    • Mitarbeiter
    • Personalbeschaffung
    • Abwesenheiten
    • Mitarbeiterbeurteilung
    • Personalempfehlungen
    • Fuhrpark
    Marketing
    • Social Marketing
    • E-Mail-Marketing
    • SMS-Marketing
    • Veranstaltungen
    • Marketing-Automatisierung
    • Umfragen
    Dienstleistungen
    • Projekte
    • Zeiterfassung
    • Außendienst
    • Kundendienst
    • Planung
    • Termine
    Produktivität
    • Dialog
    • Künstliche Intelligenz
    • IoT
    • VoIP
    • Wissensdatenbank
    • WhatsApp
    Apps von Drittanbietern Odoo Studio Odoo Cloud-Plattform
  • Branchen
    Einzelhandel
    • Buchladen
    • Kleidergeschäft
    • Möbelhaus
    • Lebensmittelgeschäft
    • Baumarkt
    • Spielwarengeschäft
    Essen & Gastgewerbe
    • Bar und Kneipe
    • Restaurant
    • Fast Food
    • Gästehaus
    • Getränkehändler
    • Hotel
    Immobilien
    • Immobilienagentur
    • Architekturbüro
    • Baugewerbe
    • Immobilienverwaltung
    • Gartenarbeit
    • Eigentümervereinigung
    Beratung
    • Buchhaltungsfirma
    • Odoo-Partner
    • Marketingagentur
    • Anwaltskanzlei
    • Talentakquise
    • Prüfung & Zertifizierung
    Fertigung
    • Textil
    • Metall
    • Möbel
    • Speisen
    • Brauerei
    • Firmengeschenke
    Gesundheit & Fitness
    • Sportklub
    • Brillengeschäft
    • Fitnessstudio
    • Therapeut
    • Apotheke
    • Friseursalon
    Handel
    • Handyman
    • IT-Hardware & -Support
    • Solarenergiesysteme
    • Schuster
    • Reinigungsdienstleistungen
    • HLK-Dienstleistungen
    Sonstiges
    • Gemeinnützige Organisation
    • Umweltschutzagentur
    • Plakatwandvermietung
    • Fotostudio
    • Fahrrad-Leasing
    • Software-Händler
    Alle Branchen ansehen
  • Community
    Lernen
    • Tutorials
    • Dokumentation
    • Zertifizierungen
    • Schulung
    • Blog
    • Podcast
    Bildung fördern
    • Bildungsprogramm
    • Scale-Up! Planspiel
    • Odoo besuchen
    Software anfragen
    • Herunterladen
    • Editionen vergleichen
    • Releases
    Zusammenarbeiten
    • Github
    • Forum
    • Veranstaltungen
    • Übersetzungen
    • Partner werden
    • Dienstleistungen für Partner
    • Buchhaltungsfirma registrieren
    Services anfragen
    • Partner finden
    • Buchhalter finden
    • Einen Experten treffen
    • Implementierungsservices
    • Kundenreferenzen
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Eine Demo erhalten
  • Preise
  • Hilfe
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Hilfe

Modifying Purchase Order Report - Odoo Online

Abonnieren

Erhalten Sie eine Benachrichtigung, wenn es eine Aktivität zu diesem Beitrag gibt

Diese Frage wurde gekennzeichnet
inheritancereportspurchase_order
2 Antworten
866 Ansichten
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
Verwerfen
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Beste Antwort

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
Verwerfen
Avatar
Zehntech Technologies Inc.
Beste Antwort

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
Verwerfen
Diskutieren Sie gerne? Treten Sie bei, statt nur zu lesen!

Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!

Registrieren
Verknüpfte Beiträge Antworten Ansichten Aktivität
RfQ/PO don't use supplier or manufacturer product name/nr
reports purchase_order
Avatar
1
Apr. 26
4052
Loading for forever on clicking on save button.
inheritance purchase_order loading
Avatar
Avatar
1
Juli 23
3748
Purchase order READONLY_STATES inherit
inheritance purchase_order odoo9
Avatar
Avatar
1
Juli 23
6343
Modify report template request for quotation and order
templates reports purchase_order
Avatar
0
Dez. 23
6139
'order' object has no attribute '_line_no' while making custom reports
rml reports purchase_order
Avatar
0
März 15
4258
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Herunterladen
  • Github
  • Runbot
  • Übersetzungen
Dienstleistungen
  • Odoo.sh-Hosting
  • Support
  • Upgrade
  • Individuelle Entwicklungen
  • Bildung
  • Buchhalter finden
  • Partner finden
  • Partner werden
Über uns
  • Unsere Firma
  • Markenwerte
  • Kontakt
  • Karriere
  • Veranstaltungen
  • Podcast
  • Blog
  • Kunden
  • Rechtliches • Datenschutz
  • Sicherheit
الْعَرَبيّة 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 ist eine Suite von Open-Source-Betriebsanwendungen, die alle Bedürfnisse Ihres Unternehmens abdecken: CRM, E-Commerce, Buchhaltung, Lager, Kassensystem, Projektmanagement etc.

Das einzigartige Wertversprechen von Odoo ist, dass es gleichzeitig sehr einfach zu bedienen und voll integriert ist.

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