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

[8] Odoo Custom Report Page

Suscribirse

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

Se marcó esta pregunta
qwebreportodooV8
3 Respuestas
4647 Vistas
Avatar
Randy Raharjo

I have my own custom module, named master.py

from openerp.osv import fields, osv
from openerp.tools.translate import _
from openerp import tools
import datetime
import itertools

class mmr_brand(osv.osv):
_name = "mmr.brand"
_description = "Brand Module for PT.MMR, for easier input and prevent duplication."

_columns = {
'name': fields.char("Brand", required=True),
'notes' : fields.char("Notes"),
}

mmr_brand()

class mmr_unit(osv.osv):
_name = "mmr.unit"
_description = "Unit Module for PT.MMR, for easier input and prevent duplication."

_columns = {
'name': fields.char("Unit", required=True),
'notes' : fields.char("Notes"),
}

mmr_unit()


class mmr_product(osv.osv):

_name = "mmr.product"
_description = "Product Module for PT.MMR, refer to Product doc."

_columns = {
'brand': fields.many2one("mmr.brand", "Brand", required=True),
'name': fields.char("Name", required=True),
'unit': fields.many2one("mmr.unit", "Unit", required=True),
'minimumSellPrice': fields.float("Minimum sell price"),
}

mmr_product()

With view named master,

<openerp>
<data>
<record id="mmr_product_list" model="ir.ui.view">
<field name="name">mmr.product.list</field>
<field name="model">mmr.product</field>
<field name="arch" type="xml">
<tree string="Product" version="7.0">
<field name="brand" />
<field name="name" />
<field name="unit" />
<field name="minimumSellPrice" />
</tree>
</field>
</record>

<record id="mmr_product_form" model="ir.ui.view">
<field name="name">mmr.product.form</field>
<field name="model">mmr.product</field>
<field name="arch" type="xml">
<form string="Product" version="7.0" >
<header>
<button name="%(report_example)d" string="Print" type="action"/>
</header>
<group>
<field name="brand" />
<field name="name" />
<field name="unit" />
<field name="minimumSellPrice" />
</group>
</form>
</field>
</record>

<record id="mmr_brand_list" model="ir.ui.view">
<field name="name">mmr.brand.list</field>
<field name="model">mmr.brand</field>
<field name="arch" type="xml">
<tree string="Brand" version="7.0">
<field name="name" />
<field name="notes" />
</tree>
</field>
</record>

<record id="mmr_brand_form" model="ir.ui.view">
<field name="name">mmr.brand.form</field>
<field name="model">mmr.brand</field>
<field name="arch" type="xml">
<form string="Brand" version="7.0" >
<group>
<field name="name" />
<field name="notes" />
</group>
</form>
</field>
</record>

</data>
</openerp>

And Menu named menu_master,

<openerp>
<data>
<record id="multi_action_master_mmr_product" model="ir.actions.act_window">
<field name="name">Product</field>
<field name="res_model">mmr.product</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>

<menuitem id="mmr_menu" name="MMR" sequence="111" groups="base.group_user"/>

<menuitem id="mmr_menu_product" name="Product" parent="mmr_menu" sequence="1" />
<menuitem id="multi_menu_master_product" action="multi_action_master_mmr_product" name="Product" parent="mmr_menu_product" sequence="1" />

</data>
</openerp>

I also have created xml containing report template, i named the file reportExample.xml and placed it in view folder

<?xml version="1.0" encoding="utf-8"?>
<!--Custom report.-->
<openerp>
<data>

<template id="report_example">
<t t-call="report.external_layout">
<div class="page">
<div class="row">
<h3>Title</h3>
</div>
</div>
</t>
</template>

</data>
</openerp>

Then I also create xml named MMR_report.xml, containing

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<report
id="custom_report_example"
model="mmr.product"
string="Example"
report_type="qweb-pdf"
name="mmr.report_example"
attachment_use="False"
file="mmr.report_example"
/>
</data>
</openerp>

Also, I already noticed __openerp__ file about my new report

 'update_xml': [  
'view/reportExample.xml',
'view/master.xml',
'menu/menu_master.xml',
],

As you can see, I already insert button which I expect to show my custom report page when i pressed it. Unfortunately it doesn't work. Can someone explain what wrong with it?

0
Avatar
Descartar
Avatar
Ankit H Gandhi(AHG)
Mejor respuesta

Dear Mrpingu,

Your code is good but you do one mistake in button so please replace your code with my code.

Your code

<button name="%(report_example)d" string="Print" type="action"/>  

My code

<button name="%(custom_report_example)d" string="Print" type="action"/>


Hope this help full for you

Thanks & Regards

Ankit H Gandhi.

1
Avatar
Descartar
Avatar
Randy Raharjo
Autor Mejor respuesta

Thx Ankit Gandhi for the answer!


So I will write what I learn from this:

1.    To make report you need to write the template and fill the ID. You can just fill the template with <h2>Test<\h2> for testing purpose

2.    Then you will need to register your report using <report> tag. You can fill the ID, model(what class you want this report about), name and file (Your module folder name.Your template ID) 

3. Voila! Your class should have print button beside more dropdown button

4. Hope it helps!


0
Avatar
Descartar
Avatar
Zbik
Mejor respuesta

You define security rights in ir.model.access.csv for your custom module.

0
Avatar
Descartar
¿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
How to restrict user to save print report in their local system?
qweb report odooV8
Avatar
0
dic 17
4396
How to dynamically change report Name odoo v8
qweb report odooV8
Avatar
Avatar
1
sept 17
5875
How to create report (fields based on existing model)
qweb report odooV8
Avatar
Avatar
2
feb 17
8095
How to change footer position/height in qweb reports ? Resuelto
qweb report odooV8
Avatar
Avatar
1
ago 16
17656
Vertical header in invoice and sale_order reports
qweb report odooV8
Avatar
0
ene 16
3975
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