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

PDF Quote Builder - change which PDF report is used

Suscribirse

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

Se marcó esta pregunta
pdfqwebquotereportbuilder
1 Responder
1903 Vistas
Avatar
kll

Hi! We use Odoo Online (v18).

We want to use the Quote Builder to create beautiful quotes. To achieve this, we would like to customize the PDF to be in landscape rather than portrait format.

We couldn't easily change the paper format of the default sale.report_saleorder​ report, so we created a new report with a landscape paper format, copy/pasting most of the content of the quote (code below).

The new report works fine, but we don't know how to replace the PDF template that is used when generating a full PDF with the Quote Builder.

So: How do we replace the default PDF template used with the Quote Builder?

Here's the full code of the new report:

<t t-name="sale.report_saleorder_document">
    <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" 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">
                <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="">N° TVA</t>: <span t-field="doc.partner_id.vat"/>
            </p>
        </t>
        <t t-if="doc.partner_shipping_id == doc.partner_invoice_id                              and doc.partner_invoice_id != doc.partner_id                              or doc.partner_shipping_id != doc.partner_invoice_id">
            <t t-set="information_block">
                <strong>
                    <t t-if="doc.partner_shipping_id == doc.partner_invoice_id">
                        Adresse de facturation et d'expédition
                    </t>
                    <t t-else="">
                        Adresse de facturation
                    </t>
                </strong>
                <div t-field="doc.partner_invoice_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}"/>
                <t t-if="doc.partner_shipping_id != doc.partner_invoice_id">
                    <strong>Adresse de livraison</strong>
                    <div t-field="doc.partner_shipping_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}"/>
                </t>
            </t>
        </t>
        <div class="page">
            <div class="oe_structure"/>

            <t t-set="is_proforma" t-value="env.context.get('proforma', False) or is_pro_forma"/>
            <t t-set="layout_document_title">
                <span t-if="is_proforma">Facture pro forma # </span>
                <span t-elif="doc.state in ['draft','sent']">Devis # </span>
                <span t-else="">Commande # </span>
                <span t-field="doc.name">SO0000</span>
            </t>

            <div class="row mb-4" id="informations">
                <div t-if="doc.client_order_ref" class="col" name="informations_reference">
                    <strong>Votre Référence</strong>
                    <div t-field="doc.client_order_ref">SO0000</div>
                </div>
                <div t-if="doc.date_order" class="col" name="informations_date">
                    <strong t-if="is_proforma">Issued Date</strong>
                    <strong t-elif="doc.state in ['draft', 'sent']">Date du devis</strong>
                    <strong t-else="">Date de la commande</strong>
                    <div t-field="doc.date_order" t-options="{&quot;widget&quot;: &quot;date&quot;}">31-12-2023</div>
                </div>
                <div t-if="doc.validity_date and doc.state in ['draft', 'sent']" class="col" name="expiration_date">
                    <strong>Echéance</strong>
                    <div t-field="doc.validity_date">31-12-2023</div>
                </div>
                <div t-if="doc.user_id.name" class="col">
                    <strong>Vendeur</strong>
                    <div t-field="doc.user_id">Mitchell Admin</div>
                </div>
            </div>

            <!-- Is there a discount on at least one line? -->
            <t t-set="lines_to_report" t-value="doc._get_order_lines_to_report()"/>
            <t t-set="display_discount" t-value="any(l.discount for l in lines_to_report)"/>

            <div class="oe_structure"/>
            <table class="o_has_total_table table o_main_table table-borderless">
                <!-- In case we want to repeat the header, remove "display: table-row-group" -->
                <thead style="display: table-row-group">
                    <tr>
                        <th name="th_description" class="text-start">Description</th>
                        <th name="th_quantity" class="text-end text-nowrap">Quantité</th>
                        <th name="th_priceunit" class="text-end text-nowrap">Prix unitaire</th>
                        <th name="th_discount" t-if="display_discount" class="text-end">
                            <span>Rem.%</span>
                        </th>
                        <th name="th_taxes" class="text-end">Taxes</th>
                        <th name="th_subtotal" class="text-end">
                            <span>Montant</span>
                        </th>
                    </tr>
                </thead>
                <tbody class="sale_tbody">

                    <t t-set="current_subtotal" t-value="0"/>

                    <t t-foreach="lines_to_report" t-as="line">

                        <t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal"/>

                        <tr t-att-class="'fw-bold o_line_section' if (                                 line.display_type == 'line_section'                                 or line.product_type == 'combo'                             )                             else 'fst-italic o_line_note' if line.display_type == 'line_note'                             else ''">
                            <t t-if="not line.display_type and line.product_type != 'combo'">
                                <td name="td_name"><span t-field="line.name">Burger au bacon</span></td>
                                <td name="td_quantity" class="text-end text-nowrap">
                                    <span t-field="line.product_uom_qty">3</span>
                                    <span t-field="line.product_uom">unités</span>
                                    <span t-if="line.product_packaging_id">
                                        (<span t-field="line.product_packaging_qty" t-options="{&quot;widget&quot;: &quot;integer&quot;}"/> <span t-field="line.product_packaging_id"/>)
                                    </span>
                                </td>
                                <td name="td_priceunit" class="text-end text-nowrap">
                                    <span t-field="line.price_unit">3</span>
                                </td>
                                <td t-if="display_discount" class="text-end">
                                    <span t-field="line.discount">-</span>
                                </td>
                                <t t-set="taxes" t-value="', '.join([(tax.invoice_label or tax.name) for tax in line.tax_id])"/>
                                <td name="td_taxes" t-attf-class="text-end {{ 'text-nowrap' if len(taxes) &lt; 10 else '' }}">
                                    <span t-out="taxes">Taxe 15%</span>
                                </td>
                                <td t-if="not line.is_downpayment" name="td_subtotal" class="text-end o_price_total">
                                    <span t-field="line.price_subtotal">27.00</span>
                                </td>
                            </t>
                            <t t-elif="line.display_type == 'line_section' or line.product_type == 'combo'">
                                <td name="td_section_line" colspan="99">
                                    <span t-field="line.name">Un titre de section</span>
                                </td>
                                <t t-set="current_section" t-value="line"/>
                                <t t-set="current_subtotal" t-value="0"/>
                            </t>
                            <t t-elif="line.display_type == 'line_note'">
                                <td name="td_note_line" colspan="99">
                                    <span t-field="line.name">Note dont le contenu s'applique généralement à la section ou au produit ci-dessus.</span>
                                </td>
                            </t>
                        </tr>

                        <t t-if="current_section and (                                 line_last                                 or lines_to_report[line_index+1].display_type == 'line_section'                                 or lines_to_report[line_index+1].product_type == 'combo'                                 or (                                     line.combo_item_id                                     and not lines_to_report[line_index+1].combo_item_id                                 )                             ) and not line.is_downpayment">
                            <t t-set="current_section" t-value="None"/>
                            <tr class="is-subtotal text-end">
                                <td name="td_section_subtotal" colspan="99">
                                    <strong class="mr16">Sous-total</strong>
                                    <span t-out="current_subtotal" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: doc.currency_id}">31.05</span>
                                </td>
                            </tr>
                        </t>
                    </t>
                </tbody>
            </table>
            <div class="clearfix" name="so_total_summary">
                <div id="total" class="row mt-n3" name="total">
                    <div t-attf-class="#{'col-6' if report_type != 'html' else 'col-sm-7 col-md-6'} ms-auto">
                        <table class="o_total_table table table-borderless">
                            <!-- Tax totals -->
                            <t t-call="sale.document_tax_totals">
                                <t t-set="tax_totals" t-value="doc.tax_totals"/>
                                <t t-set="currency" t-value="doc.currency_id"/>
                            </t>
                        </table>
                    </div>
                </div>
            </div>
            <div class="oe_structure"/>

            <div t-if="not doc.signature" class="oe_structure"/>
            <div t-else="" class="mt-4 ml64 mr4" name="signature">
                <div class="offset-8">
                    <strong>Signature</strong>
                </div>
                <div class="offset-8">
                    <img t-att-src="image_data_uri(doc.signature)" style="max-height: 4cm; max-width: 8cm;"/>
                </div>
                <div class="offset-8 text-center">
                    <span t-field="doc.signed_by">Oscar Morgan</span>
                </div>
            </div>
            <div>
                <span t-field="doc.note" t-attf-style="#{'text-align:justify;text-justify:inter-word;' if doc.company_id.terms_type != 'html' else ''}" name="order_note"/>
                <p t-if="not is_html_empty(doc.payment_term_id.note)">
                    <span t-field="doc.payment_term_id.note">Le paiement doit également être transmis avec amour</span>
                </p>
                <div class="oe_structure"/>
                <p t-if="doc.fiscal_position_id and not is_html_empty(doc.fiscal_position_id.sudo().note)" id="fiscal_position_remark">
                    <strong>Remarque sur le régime fiscal :</strong>
                    <span t-field="doc.fiscal_position_id.sudo().note">Pas d'autres exigences pour ce paiement</span>
                </p>
            </div>
            <div class="oe_structure"/>
        </div>
    </t>
</t>
0
Avatar
Descartar
Avatar
Ray Carnes (ray)
Mejor respuesta

Rename the Template Name on your new Report.

Odoo checks that the Report being requested has the Template Name sale.report_saleorder and only includes the header / footer components if that is the case.


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
Conditional column on table
pdf qweb report
Avatar
0
may 24
2657
Change font in QWeb template
pdf qweb report
Avatar
Avatar
Avatar
2
may 24
4817
Sale Order PDF Report Resuelto
pdf qweb report
Avatar
Avatar
Avatar
Avatar
3
feb 24
4175
[ODOO 15] PDF in Qweb Report
pdf qweb report
Avatar
Avatar
Avatar
2
nov 22
6849
Invoice on basic layout
pdf invoice qweb report
Avatar
0
abr 24
2592
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