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

How to add all the employees in an rml report??

Suscribirse

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

Se marcó esta pregunta
rmlreportopenerp7
4 Respuestas
4265 Vistas
Avatar
Rihene

Hello!!

I work with a class named test_example:


class test_example(osv.osv):

_name = 'test.example'

_columns = {

'date_start': fields.date('Date Start ',size=256),

'date_end': fields.date('Date End ',size=256),

'company_id': fields.many2one('res.company', string ="Company Name",size=256),

}

I want to create a report which will contains all the employees of the selected company.

Please help

I really need an answer please

-2
Avatar
Descartar
Yenthe Van Ginneken (Mainframe Monkey)

Please don't create double posts for exactly the same.. You could have easily modified your initial topic and added this code.

Rihene
Autor

try to answer !!!

Yenthe Van Ginneken (Mainframe Monkey)

Sorry but I never work with RML reports. They're from V7 and will soon be deprecated so I never use them.. Can't answer this one for you.

Avatar
Axel Mendoza
Mejor respuesta

First for every report you need a source for the report, because you need all the employees of an specific company first you need to select the company in a wizard like form that have the print button or you could use the company form itself. You need to define what will be the model of the report, could be res.company or hr.employee. More direct solution is to define the report on the hr.employee (that not means that the print button need to be in the employee form, just the type of records that you iterate on the report). Next in your case you need to filter the employees by the selected company. That's better in a wizard like form, you select the company, clic on the print button that call a method in your wizard and search the employees ids filtering by the selected company and pass it to the report by the context, something like this:

    def print_btn(self, cr, uid, ids, context=None):
company_id = self.browse(cr, uid, ids, context=context)[0].company_id
employee_ids = self.pool.get('hr.employee').search(cr, uid, [('company_id','=',company_id)])
context = dict(context or {}, active_ids=employee_ids)
return { 'type': 'ir.actions.report.xml', 'report_name': 'employee.report', 'context': context, }

next you just need to define your rml report in xml and the report itself. For iterate on the employees:

<?xml version="1.0"?>
<document filename="test.pdf">
  <template title="Employees" author="Soltein" allowSplitting="20">
    <pageTemplate id="first">
      	<pageGraphics>
      	    <image x="20" y="760" height="70.0">[[company.logo]]</image>
      	    <rect x="15" y="750" width="410" height="3" fill="yes" stroke="yes"/>
      	    <rect x="425" y="746" width="155" height="12" fill="yes" stroke="yes"/>
      	    <setFont name="Helvetica" size="8"/>
      	    <drawRightString x="550" y="15">Pág.: <pageNumber/> / <pageCount/></drawRightString>
      	    <fill color="white"/>
      	    <setFont name="Helvetica-Bold" size="9"/>
      	    <drawString x="440" y="750">[[company.website]]</drawString>
	    </pageGraphics>
      <frame id="first" x1="15.0" y1="20.0" width="560" height="800"/>
    </pageTemplate>
  </template>
<story>
<blockTable colWidths="534.0"> <tr> <td> <para>Name</para> </td> </tr> </blockTable>
<blockTable colWidths="534.0"> <tr>[[ repeatIn(objects,'o') ]] <td> <para>[[ o.name ]]</para> </td> </tr> </blockTable> 
</story> </document>

That is a very simple report template, you could add more columns to the blocktable and don't forget to change colwidths with a value for every column that you put in the blocktable. You will be iterating for every employee as 'o' and to output any field of the employee you use this syntax [[ o.field ]]

1
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 position result on the horizontal? Resuelto
rml report openerp7
Avatar
1
sept 15
3947
Couldnt load openerp report designer
rml report openerp7
Avatar
0
ago 15
3357
How to modify a simple report? Resuelto
rml report openerp7 overwriting
Avatar
1
mar 15
5647
How to print the doc no. (Purchase Order no. or invoice no.) on each page of PDF report Resuelto
rml report
Avatar
Avatar
Avatar
3
jul 24
9314
Spliting rml intotwo halves
rml openerp7
Avatar
0
abr 18
3307
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