Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Umělá inteligence
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Procházet všechna odvětví
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Služby pro partnery
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

Odoo 19 Enterprise - Customer address in invoice header

Odebírat

Get notified when there's activity on this post

This question has been flagged
invoicexmlstudio
1 Odpovědět
1224 Zobrazení
Avatar
Marcos Perez

Good morning,

I’m working with Odoo 19 Enterprise and I need to customize the invoice report.

As usual, to modify the report, I’m using an extension view with XPath.

My client has requested that the customer’s address be moved to the header in order to avoid extra pages when "Verifactu" is added.

I’ve already created the XML to achieve this. I know it’s not the most elegant solution, but it works. However, I’m running into an issue: in preview mode, the address appears at the top as expected, but when I print the invoice, it shows up after the header.

What’s even stranger is that if I use a negative position value, it places the content behind the header.

I’m not sure why this is happening.

XML:

<data>
<xpath expr="//div[@name='address_same_as_shipping']" position="replace">
<div name="address_same_as_shipping">
<t t-set="address">
<div style="position: absolute; top: 50px">
<address class="mb-0" t-field="o.partner_id" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;], &quot;no_marker&quot;: True}"/>
<div t-if="o.partner_id.vat" id="partner_vat_address_same_as_shipping">
<t t-if="o.company_id.account_fiscal_country_id.vat_label" t-out="o.company_id.account_fiscal_country_id.vat_label" id="inv_tax_id_label"/>
<t t-else="">Tax ID</t>: <span t-field="o.partner_id.vat"/>
</div>
<div t-if="o.partner_id.country_code == 'MA' and o.partner_id.company_registry">
ICE: <a t-field="o.partner_id.company_registry"/>
</div>
</div>
</t>
</div>
</xpath>
</data>

Thanks in advance for your help!

0
Avatar
Zrušit
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Nejlepší odpověď
Hi,

The issue occurs because Odoo uses two different rendering engines for reports: the browser for preview and wkhtmltopdf for PDF printing. While your modification using position: absolute works correctly in preview mode, wkhtmltopdf handles positioning differently and does not respect absolute positioning in the same way. As a result, elements may shift below the header or appear behind it when printed.

This happens because the invoice report is built using web.external_layout, where the header and body are rendered in separate structural sections. Your address block is still part of the body, and CSS positioning cannot reliably move it into the header area in PDF mode.

The correct solution is not to use CSS tricks like absolute positioning or negative offsets, but instead to move the address structurally into the header by inheriting and modifying the web.external_layout template. By placing the address directly inside the header container and removing it from the body, the layout will render consistently in both preview and printed PDF formats.

Hope it helps

1
Avatar
Zrušit
Marcos Perez
Autor

Hello,

Thank you very much for the detailed explanation. I knew that something made it different when previewing and in the actual print.

I did what you told me about putting the address at the top, and it worked!.

Now that I know it can be done, another problem has come up and the question is:

How can I make it so that the address only appears in the invoice reports? Currently, it is shown in all reports. I thought about using "t-if," but what should I compare it with? I can't do something like o.partner_id since each report references the record differently. For example, in quotations, it is referenced as doc.partner_id.

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
XML ITALIA INVOICES are not created for goods sold abroad Vyřešeno
invoice xml
Avatar
Avatar
2
bře 26
1066
How can i decorate or customize badge widget using Odoo: Studio ONLY Vyřešeno
xml studio
Avatar
Avatar
1
led 26
1370
Add a "last page" in invoices with terms & conditions
invoice studio
Avatar
Avatar
2
bře 25
3212
Display VAT on the invoice using Odoo Studio Vyřešeno
invoice studio
Avatar
Avatar
2
led 21
6258
Studio changes create a big mess in XML Vyřešeno
xml studio
Avatar
Avatar
1
bře 25
4404
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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