Ir al contenido
Odoo Menú
  • Identificarse
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • TPV para tiendas
    • TPV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en directo
    • eLearning
    Cadena de suministro
    • Inventario
    • Fabricación
    • PLM
    • Compra
    • Mantenimiento
    • Calidad
    Recursos Humanos
    • Empleados
    • Reclutamiento
    • Ausencias
    • Evaluación
    • Referencias
    • Flota
    Marketing
    • Marketing social
    • Marketing por correo electrónico
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyecto
    • Partes de horas
    • Servicio de campo
    • Servicio de asistencia
    • Planificación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Información
    • WhatsApp
    Aplicaciones de terceros Studio de Odoo Plataforma de Odoo Cloud
  • Industrias
    Comercio al por menor
    • Librería
    • Tienda de ropa
    • Tienda de muebles
    • Tienda de ultramarinos
    • Ferretería
    • Juguetería
    Food & Hospitality
    • Bar y taberna
    • Restaurante
    • Comida rápida
    • Guest House
    • Distribuidor de bebidas
    • Hotel
    Real Estate
    • Real Estate Agency
    • Estudio de arquitectura
    • Construcción
    • Gestión inmobiliaria
    • Jardinería
    • Asociación de propietarios
    Consulting
    • Accounting Firm
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Fabricación
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Trades
    • Handyman
    • Hardware y asistencia informática
    • Solar Energy Systems
    • Zapatero
    • Servicios de limpieza
    • HVAC Services
    Others
    • Nonprofit Organization
    • Agencia de protección del medio ambiente
    • Alquiler de paneles publicitarios
    • Estudio fotográfico
    • Alquiler de bicicletas
    • Distribuidor de software
    Browse all Industries
  • Comunidad
    Aprender
    • Tutoriales
    • Documentación
    • Certificaciones
    • Formación
    • Blog
    • Podcast
    Potenciar la educación
    • Programa de formación
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtener el software
    • Descargar
    • Comparar ediciones
    • Versiones
    Colaborar
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Convertirse en partner
    • Services for Partners
    • Registrar tu empresa contable
    Obtener servicios
    • Encontrar un partner
    • Encontrar un asesor fiscal
    • Contacta con un experto
    • Servicios de implementación
    • Referencias de clientes
    • Ayuda
    • Actualizaciones
    GitHub YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicitar 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
  • Proyecto
  • 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

i want to print report base on condition

Suscribirse

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

Se marcó esta pregunta
reportingodoov15
1 Responder
3778 Vistas
Avatar
Ra_one_1_11

hello everyone ,


i have 5 date fields and i deed to print report which is 5 page. so i need if date1 is add so print page 1 , if date2 is add so print page 2 


is tahat possible or not ??


thanks in advance 

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

Hi,

Suppose you have the fields date1, date2, date3, date4, and date5. As you mentioned, you have 5 pages in the report template. So, you can add conditions based on the date fields.
For example, if you have already placed the contents of each pages in a block like a division:

<div t-if="date1">


    <!--  Page 1 code  -->


</div>


<div t-if="date2">


    <!--  Page 2 code  -->


</div>


<div t-if="date3">


    <!--  Page 3 code  -->


</div>


<div t-if="date4">


    <!--  Page 4 code  -->


</div>


<div t-if="date5">


    <!--  Page 5 code  -->


</div>




If you don't have any such blocks, you can add one. Since it is a template, you can also use the t tag:

<t t-if="date1">


    <!--  Page 1 code  -->


</t>


<t t-if="date2">


    <!--  Page 2 code  -->


</t>


<t t-if="date3">


    <!--  Page 3 code  -->


</t>


<t t-if="date4">


    <!--  Page 4 code  -->


</t>


<t t-if="date5">


    <!--  Page 5 code  -->


</t>


Regards

1
Avatar
Descartar
Ra_one_1_11
Autor

this is not possible because i dont have 5 different pages but i add loop for pages . in my report two colums first is content and second is number . the conytent are same for all page but number are different for all pages .

Cybrosys Techno Solutions Pvt.Ltd

So, you have a report with 2 columns. Are the numbers in the second column unique for each date? (You just mentioned that the numbers are different for all pages.) If yes, then you can add a variable in the report where you can set the value there based on the dates and use that variable within the for loop to add only matching rows. For example,
<!-- Set the number corresponding for the date in col_val. 1 to 5 is used here for example and 0 as default value -->
<t t-set="col_val" t-value="0" />
<t t-if="date1">
<t t-set="col_val" t-value="1" />
</t>
<t t-if="date2">
<t t-set="col_val" t-value="2" />
</t>
<t t-if="date3">
<t t-set="col_val" t-value="3" />
</t>
<t t-if="date4">
<t t-set="col_val" t-value="4" />
</t>
<t t-if="date5">
<t t-set="col_val" t-value="5" />
</t>

If you have used the for loop in <tr>, move it into another block and add the condition in <tr> for the table body.

<t t-foreach="rows" t-as="row">
<tr t-if="col_val == row.number">
<td><span t-esc="row.content" /></td>
<td><span t-esc="row.number" /></td>
</tr>
<t>

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

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

Inscribirse
Publicaciones relacionadas Respuestas Vistas Actividad
ODOO 15 for "Einnahmenüberschussrechnung EÜR"
reporting v15
Avatar
Avatar
Avatar
2
ago 25
3886
report layout generates error on pdf export but works in preview
reporting v15
Avatar
Avatar
1
abr 25
5334
Reports: table headers repeating PO vs SO Resuelto
reporting v15
Avatar
Avatar
2
jul 24
6919
Insert image into a report Resuelto
reporting v15
Avatar
Avatar
1
abr 24
2660
How to hide the add detail line button of an order
odoo v15
Avatar
1
dic 23
3410
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento Odoo.sh
  • Ayuda
  • Actualizar
  • Desarrollos personalizados
  • Educación
  • Encontrar un asesor fiscal
  • Encontrar un partner
  • Convertirse en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contacta con nosotros
  • Puestos de trabajo
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Información 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 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