Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Artificial Intelligence
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Property Management
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

Odoo 19 Enterprise - Customer address in invoice header

Subscriure's

Get notified when there's activity on this post

This question has been flagged
invoicexmlstudio
1 Respondre
1227 Vistes
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
Descartar
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Best Answer
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
Descartar
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!

Registrar-se
Related Posts Respostes Vistes Activitat
XML ITALIA INVOICES are not created for goods sold abroad Solved
invoice xml
Avatar
Avatar
2
de març 26
1069
How can i decorate or customize badge widget using Odoo: Studio ONLY Solved
xml studio
Avatar
Avatar
1
de gen. 26
1372
Add a "last page" in invoices with terms & conditions
invoice studio
Avatar
Avatar
2
de març 25
3212
Display VAT on the invoice using Odoo Studio Solved
invoice studio
Avatar
Avatar
2
de gen. 21
6264
Studio changes create a big mess in XML Solved
xml studio
Avatar
Avatar
1
de març 25
4408
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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