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

[V8] [Qweb] Footer only on the last page

Suscribirse

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

Se marcó esta pregunta
6 Respuestas
17931 Vistas
Avatar
Francesco OpenCode

I need to show footer only on the last page of a pdf report. It's possibile or I'm a dreamer?

6
Avatar
Descartar
Davide Corio

AFAIK, there's no official way to achieve that but, considering this: https://github.com/odoo/odoo/blob/8.0/addons/report/static/src/js/subst.js you can hide/show you footer by checking the page number (via custom javascript). For instance, you'll find the page number and the total number of pages here in the default report layout: https://github.com/odoo/odoo/blob/8.0/addons/report/views/layouts.xml#L107

Davide Corio

converted my answer to comment by mistake and it deleted your comment...sorry. btw, i tested it and you're right. that doen't work :(

Avatar
Paul Catinean
Mejor respuesta

Hello Francesco I have been wanting to submit this to odoo for quite a while and maybe I will, here is how I did it:

        <template id="report_minimal_layout" inherit_id="report.minimal_layout" >
            <xpath expr="//head" position="inside">
              <script src='/module_name/static/js/pagination_hide.js'></script> <-- Must be added in the module -->
            </xpath>

            <xpath expr="//body" position="attributes">
                <attribute t-translation="off" name="onload">subst(); pagination_hide();</attribute>
            </xpath>
        </template>

Contents of the js file:

function pagination_hide() {
    var vars = {};
    var x = document.location.search.substring(1).split('&');
    for (var i in x) {
        var z = x[i].split('=', 2);
        vars[z[0]] = unescape(z[1]);
    }

    if (vars['page'] <= 1){
        hidden_nodes = document.getElementsByClassName("hide_firstpage");
        for (i = 0; i < hidden_nodes.length; i++) {
            hidden_nodes[i].style.visibility = "hidden";
        }
    }

    if (vars['page'] == vars['topage']){
        hidden_nodes = document.getElementsByClassName("show_lastpage");
        for (i = 0; i < hidden_nodes.length; i++) {
            hidden_nodes[i].style.display = "block";
        }
    }

    if (vars['page'] == 1){
        hidden_nodes = document.getElementsByClassName("show_firstpage");
        for (i = 0; i < hidden_nodes.length; i++) {
            hidden_nodes[i].style.display = "block";
        }
    }
}

Of course this will not actually remove the footer and allow for the body content to stretch to the very bottom but it show/hides depending on the page it is on using css to alter the display property

After doing this you can use these helper classes which do pretty much what they say

 

 

4
Avatar
Descartar
Avatar
Tuanna
Mejor respuesta

Hello Francesco,

This module from OCA can solve your problem

https://github.com/OCA/reporting-engine/tree/8.0/report_qweb_element_page_visibility

1
Avatar
Descartar
Avatar
Valentin Lab
Mejor respuesta

A module implemeting a magical `last-page` class has been developed (by me) to showcase a basic possible implementation.

    https://github.com/0k/report_extended

A stackoverflow answer explain how this works in a viable place for posting code:

    http://stackoverflow.com/questions/28172283/checking-for-last-page-in-qweb-reports-in-odoo

Nice similar solution also on this blog post:

    http://planet.agilebg.com/en/2014/05/how-to-add-html-element-at-the-bottom-of-the-last-page-of-webkit-report/ 

0
Avatar
Descartar
Avatar
Anil Kesariya
Mejor respuesta

Hello ,

Here i have given answer for this question!

Click Here

Hope this will help,

Regards,

Anil.


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

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

Registrarse
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