Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita una demostración
  • Precios
  • Ayuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyectos
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

Customizing the Quotation PDF: How to add a customer contact person on PDF sales order? Odoo 18.3

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
debugpdf
3 Respuestas
846 Vistas
Avatar
Kim Hilgert

We work for many companies where we have different buyers so we would want the buyer on the quotation.

I added a field to sale order to select the specific contact person (x_partner_contact_id) that is shown in the form view and where we can select the right contact person.

 I want to print this contact information on pdf of sales order. I created an inherited view of the sale order report with xpath as following, but it's not showing on pdf...

<xpath expr="//p[span[@t-field='doc.partner_id.vat']]" position="after">

  <t t-if="doc.x_partner_contact_id">

    <p class="mb-0">

      <strong>Contactpersoon:</strong>

      <span t-field="doc.x_partner_contact_id.name"/>

      <t t-if="doc.x_partner_contact_id.email"> – <span t-field="doc.x_partner_contact_id.email"/></t>

      <t t-if="doc.x_partner_contact_id.phone"> – <span t-field="doc.x_partner_contact_id.phone"/></t>

    </p>

Thank you!

0
Avatar
Descartar
Kim Hilgert
Autor

I'm not looking for the sales person (is indeed there), but the buyer at the customer side. Odoo support suggests using 'delivery or invoice' address, but that is not really what I want. I want a field: contact with the name or e-mail of my contact person...

Avatar
Kim Hilgert
Autor Mejor respuesta

I tried the xpath with customer block, but there is none, this is the original architecture:

<t t-call="web.external_layout">

        <t t-set="doc" t-value="doc.with_context(lang=doc.partner_id.lang)"/>

        <t t-set="forced_vat" t-value="doc.fiscal_position_id.foreign_vat"/> <!-- So that it appears in the footer of the report instead of the company VAT if it's set -->

        <t t-set="address">

            <div t-field="doc.partner_id" class="mb-0" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;], &quot;no_marker&quot;: True}"/>

            <p t-if="doc.partner_id.vat" class="mb-0">

                <t t-if="doc.company_id.account_fiscal_country_id.vat_label" t-out="doc.company_id.account_fiscal_country_id.vat_label"/>

                <t t-else="">Tax ID</t>: <span t-field="doc.partner_id.vat"/>

In what block should I insert?

0
Avatar
Descartar
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Mejor respuesta

Hi,


Your code is correct in logic, but the issue is that your XPath is probably not matching anything in the quotation template. In some Odoo versions, the VAT field isn’t displayed, so the expression doesn’t find a target. A better anchor is the customer block (//div[@name='customer']).


Also make sure your custom field x_partner_contact_id is a stored Many2one to res.partner, and that you’ve upgraded your module or cleared cached reports after editing. Updating your XPath to the customer block will allow the buyer contact details to show correctly on the PDF.


<template id="report_saleorder_buyer_contact" inherit_id="sale.report_saleorder_document">

    <xpath expr="//div[@name='customer']" position="inside">

        <t t-if="doc.x_partner_contact_id">

            <p class="mb-0">

                <strong>Contactpersoon:</strong>

                <span t-field="doc.x_partner_contact_id.name"/>

                <t t-if="doc.x_partner_contact_id.email"> – <span t-field="doc.x_partner_contact_id.email"/></t>

                <t t-if="doc.x_partner_contact_id.phone"> – <span t-field="doc.x_partner_contact_id.phone"/></t>

            </p>

        </t>

    </xpath>

</template>


Hope it helps

0
Avatar
Descartar
Avatar
Ray Carnes (ray)
Mejor respuesta

The Quotation PDF already shows the Salesperson selected:


Form View:


PDF:

0
Avatar
Descartar
¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
How to hide units of measure in PDF reports?
sales debug pdf
Avatar
Avatar
Avatar
3
oct 25
461
How to keep footer always at the bottom of the very last page in QWeb PDF report
sales debug pdf
Avatar
Avatar
Avatar
2
ago 25
1209
(@@Iberia^AR@@)¿Cómo se llama ahora Iberia?
debug
Avatar
0
nov 25
3
Quote Builder With Custom Rental Report (Studio)
pdf
Avatar
0
oct 25
485
Quote Builder With Custom Rental Report (Studio)
pdf
Avatar
0
oct 25
4
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y estar totalmente integrado.

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