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
    Alimentación y hostelería
    • Bar y taberna
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidor de bebidas
    • Hotel
    Inmueble
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión inmobiliaria
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Empresa contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Fabricación
    • Textil
    • Metal
    • Muebles
    • Alimentos
    • Brewery
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Oficios
    • Handyman
    • Hardware y asistencia informática
    • Sistemas de energía solar
    • Zapatero
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin ánimo de lucro
    • 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

Change PDF report name on wizard

Suscribirse

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

Se marcó esta pregunta
wizardreport
2 Respuestas
4100 Vistas
Avatar
Arthur LEHAVRE

I'm using Odoo 17 and I added a custom button on the project form view that displays wizard view to recap some informations and then export them inside a PDF report. Everything works fine except one thing : I can't change the name of the PDF. 

When I don't generate the report through the native print button instead, in the project model, the field   works fine. But through a custom button, it doesn't, it keeps using the field  .

Any idea about how to change report file name through wizard?

Thanks a lot

Here is my code :


   
       My Custom PDF
       report.custom_module.my_report
       qweb-pdf
       custom_module.my_report
       custom_module.my_report
       'the name of the file'
       report
   
/
0
Avatar
Descartar
Avatar
Arthur LEHAVRE
Autor Mejor respuesta

Thanks a lot for your answer. Unfortunatly, I still have the issue. The report file name use the string instead of print_report_name. It drives me mad ! 

0
Avatar
Descartar
Avatar
Jainesh Shah(Aktiv Software)
Mejor respuesta

Hello Arthur LEHAVRE ,


To change the name of the PDF generated by your custom button in Odoo 17, you need to ensure that the filename is dynamically set in your report action. Here’s a step-by-step guide on how to achieve this:


1. Define the report action:

//Code 1 in Comment//


2. Modify the wizard to generate the report:


Ensure your wizard calls the report action with the context needed to set the filename.

//Code 2 in Comment//


3. Adjust the button in the form view to call the wizard:

   

Make sure your button in the project form view calls the wizard action.

//Code 3 in Comment//


4. Ensure the wizard action is defined:

   

Make sure your wizard action is correctly defined in the XML file.

//Code 4 in Comment//


Hope this helps.

   

If you need any help in customisation feel free to contact us.

       

Thanks & Regards,

Email:  odoo@aktivsoftware.com           

Skype: kalpeshmaheshwari

0
Avatar
Descartar
Jainesh Shah(Aktiv Software)

Code 1:

<report
id="my_custom_report"
model="project.project"
string="My Custom PDF"
report_type="qweb-pdf"
name="custom_module.my_report"
file="custom_module.my_report"
print_report_name="(object.name or 'report_name') + '_Report'"
/>

Code 2 :

class MyCustomWizard(models. TransientModel):
_name = 'custom_module.my_custom_wizard'
_description = 'Custom Wizard for PDF Report'

def action_generate_report(self):
return self.env.ref('custom_module.my_custom_report').report_action(self)

Code 3:

<record id="view_project_form" model="ir.ui.view">
<field name="name">project.form</field>
<field name="model">project.project</field>
<field name="arch" type="xml">
<form string="Project">
<!-- Your existing form view structure -->
<button name="action_generate_report" type="object" string="Generate PDF" class="btn-primary"/>
<!-- Your existing form view structure -->
</form>
</field>
</record>

Code 4:

<record id="action_my_custom_wizard" model="ir.actions.act_window">
<field name="name">My Custom Wizard</field>
<field name="res_model">custom_module.my_custom_wizard</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>

¿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
Blank report PDF from Wizard Resuelto
wizard report
Avatar
Avatar
2
abr 24
3629
External ID not found in the system
wizard report
Avatar
4
oct 20
6555
How to print report without closing wizard?
wizard report
Avatar
Avatar
1
mar 15
6086
How to generate a report from a wizard?
wizard reporting report
Avatar
Avatar
1
abr 24
33099
Close wizard after print report Resuelto
wizard report odooV8
Avatar
Avatar
Avatar
Avatar
3
feb 24
13527
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