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
    • Conocimientos
    • 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

how develop report from 2 models Odoo 10

Suscribirse

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

Se marcó esta pregunta
2 Respuestas
3525 Vistas
Avatar
Sylvie

I create a report from my module but I need to display one specify tuple from res.partner on this report.

0
Avatar
Descartar
Avatar
Sylvie
Autor Mejor respuesta

Sorry in fact I am new with Odoo and Python,maybe I am not so clear.

 I did a report from one of my model (convention) but inside that template I need to print the name of one res.partner that have  my boolean is_gerant true. Maybe your answer is the solution, I trying to understand how everything works.

0
Avatar
Descartar
Niyas Raphy (Walnut Software Solutions)

Hi sylvie,can you tell me from which model you are trying to print the report ?

OdooBot

I trying to print a report from a model I make name :convention. I send you my code.

 

Thank you

 

Sylvie Nolais

 

De : Niyas Raphy
Envoyé le :vendredi 2 juin 2017 14:54
À : Sylvie
Objet :Re: how develop report from 2 models Odoo 10

 

View Forum Post

Odoo S.A.

Hi sylvie,can you tell me from which model you are trying to print the report ?

--
Niyas Raphy

 

Sent by Odoo S.A. using Odoo.

 

Sylvie
Autor

the model i try to report is one I developp :

<?xml version="1.0" encoding="utf-8"?>

<odoo>

<data>

<!-- QWeb Reports -->

<report

id="convention_report"

model="mybeeformation.convention"

string="Conventions"

report_type="qweb-pdf"

name="myBeeFormation.report_convention_document"

file="myBeeFormation.report_convention_document"

attachment_use="False"

attachment="('convention.pdf')"

/>

<template id="report_convention_document">

<t t-call="report.html_container">

<t t-foreach="docs" t-as="o">

<t t-call="report.external_layout">

<div class="page">

<h3>CONVENTION DE FORMATION PROFESSIONNELLE CONTINUE<br/>

(Article L 920-1 du code du travail)</h3>

<p>Entre les soussignés :<br/>

<ol>

<li>(Raison sociale de l'organisme de formation): <span t-field="res_company.name"/><br/>Enregistré sous le numéro(déclaration d'activité):

<span t-field="res_company.numActivFormation"/></li>

<li>(Désignation de l'entreprise) <span t-field="o.client_id"/><br/>Représentée par

<!-- this where I need a res.partner I finally add a fields.Many2one to res.partner with a domain in my model : -->

<span t-field="o.representant_id"/>

</li>

</ol>

<p>Est conclue la convention suivante, en application des dispositions du livre IX du Code du Tavail portant organisation

de la formation professionnelle continue dans le cadre de la formation professionnelle tout au long de la vie.</p>

</p>

<h4><strong>ARTICLE 1er : Objet de la Convention</strong></h4>

<p>L'organisme <span t-field="res_company.name"/> organisera l'action de formation suivante:

<ul>

<li>Intitulé du stage: <span t-field="o.name"/></li>

<li>Objectifs: <span t-field="o.objectifConvention"/></li>

<li>Programmes et methodes (annexe 1) </li>

<li>Type d'action de formation(au sens des articles L 900-2 et L 900-6 du code du travail): <span t-field="o.action_id"/></li>

<li>Dates : Entre le <span t-field="o.dateDebut"/> et le <span t-field="o.dateFin"/></li>

<li>Durée : <span t-field="o.dureeStage"/></li>

<li>Lieu: <t t-if="o.type_stage == 'Inter'"><span t-field="o.lieu_id"/></t>

<t t-elif="o.type_stage == 'Intra'">Au sein de l'entreprise</t></li>

</ul>

</p>

<h4><strong>ARTICLE 2 : Effectif formé</strong></h4>

<p>L'organisme <span t-field="res_company.name"/> accueillera les personnes suivantes (noms et fonctions) <br/>

<strong>Stagiaires:</strong>

<t t-foreach="o.stagiaire_ids" t-as="v">

<tr>

<td>

<span t-esc="v.name"/> <span t-esc="v.function"/><br/>

</td>

</tr>

</t>

</p>

<div class="col-xs-3">

</div><br/>

<h4><strong>ARTICLE 3 : Disposition financières</strong></h4>

<p>En contrepartie de cette action de formation, l'employeur s'acquittera des couts suivants:</p>

<ul>

<li>Frais de formation: coût unitaire H.T <span t-field="o.prixFacture"/> X <span t-field="o.nbInscrit"/> Stagiaires =

<span t-esc="o.prixFacture * o.nbInscrit"/> € H.T.</li>

<li>Frais de restauration et/ou d'hebergement: coût unitaire H.T <t t-if="o.inclureFrais"><t t-set="totRest" t-value="o.r_fraisAnnexe * o.nbInscrit"/><span t-field="o.r_fraisAnnexe"/> X <span t-field="o.nbInscrit"/> =</t>

<t t-else=""><span t-esc="o.fraisTotal + o.r_fraisAnnexe"/> X <span t-field="o.nbInscrit"/> =

<t t-set="totRest" t-value="(o.fraisTotal + o.r_fraisAnnexe) * o.nbInscrit"/></t><t t-esc="totRest" /> € H.T.</li>

<li>Soit un total de<t t-esc="o.prixFacture * o.nbInscrit + totRest"/> € H.T.</li>

<li>T.V.A. (20,0%) <t t-esc="(o.prixFacture * o.nbInscrit + totRest)*0.2"/> </li>

<li>Total General <t t-esc="(o.prixFacture * o.nbInscrit + totRest)*1.2"/></li>

</ul>

<h4><strong>ARTICLE 4 : Modalités de règlement</strong></h4>

<p>Le paiement sera dû à reception de la facture.<br/>A régler: par virement</p>

<h4><strong>ARTICLE 5 : Non réalisation de la prestation de formation</strong></h4>

<p>En application de l'article L991-6 du code du travail, il est convenu entre les signataires que faute de réalisation totale ou partielle de la formation,

l'organisme prestataire devra rembourser au cocontractant les sommes indûment perçues de ce fait.</p>

<h4><strong>ARTICLE 6 : Différends éventuels</strong></h4>

<p>Si une contestation ou un différend ne peuvent être réglés à l'amiable, le Tribunal de Bayonne sera le seul compétent pour régler le litige</p>

</div>

</t>

</t>

</t>

Avatar
Niyas Raphy (Walnut Software Solutions)
Mejor respuesta

Hi, i didn't understand what exactly you meant. As far as i understood, i think you want to access the data from some other model rather than current  model. If so, you can write a parser for the report and access the required value from other model.
Below attached is a sample code of parser. inside the function you can access the value and return the value into report template

class RentalReportParser(report_sxw.rml_parse):

def __init__(self, cr, uid, name, context=None):
super(RentalReportParser, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'get_date': self.get_date,

})
self.context = context

def get_date(self):
date = datetime.datetime.now()
return date


class PrintReport(osv.AbstractModel):
_name = 'report.rental_profit_report.report_rental'
_inherit = 'report.abstract_report'
_template = 'rental_profit_report.report_rental'
_wrapped_report_class = RentalReportParser
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
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