Skip to Content
Odoo Menu
  • Log ind
  • Prøv gratis
  • Apps
    Økonomi
    • Bogføring
    • Fakturering
    • Udgifter
    • Regneark (BI)
    • Dokumenter
    • e-Signatur
    Salg
    • CRM
    • Salg
    • POS Butik
    • POS Restaurant
    • Abonnementer
    • Udlejning
    Hjemmeside
    • Hjemmesidebygger
    • e-Handel
    • Blog
    • Forum
    • LiveChat
    • e-Læring
    Forsyningskæde
    • Lagerbeholdning
    • Produktion
    • PLM
    • Indkøb
    • Vedligeholdelse
    • Kvalitet
    HR
    • Medarbejdere
    • Rekruttering
    • Fravær
    • Medarbejdersamtaler
    • Anbefalinger
    • Flåde
    Marketing
    • Markedsføring på sociale medier
    • E-mailmarketing
    • SMS-marketing
    • Arrangementer
    • Automatiseret marketing
    • Spørgeundersøgelser
    Tjenester
    • Projekt
    • Timesedler
    • Udkørende Service
    • Kundeservice
    • Planlægning
    • Aftaler
    Produktivitet
    • Dialog
    • Godkendelser
    • IoT
    • VoIP
    • Vidensdeling
    • WhatsApp
    Tredjepartsapps Odoo Studio Odoo Cloud-platform
  • Brancher
    Detailhandel
    • Boghandel
    • Tøjforretning
    • Møbelforretning
    • Dagligvarebutik
    • Byggemarked
    • Legetøjsforretning
    Mad og værtsskab
    • Bar og pub
    • Restaurant
    • Fastfood
    • Gæstehus
    • Drikkevareforhandler
    • Hotel
    Ejendom
    • Ejendomsmægler
    • Arkitektfirma
    • Byggeri
    • Ejendomsadministration
    • Havearbejde
    • Boligejerforening
    Rådgivning
    • Regnskabsfirma
    • Odoo-partner
    • Marketingbureau
    • Advokatfirma
    • Rekruttering
    • Audit & certificering
    Produktion
    • Tekstil
    • Metal
    • Møbler
    • Fødevareproduktion
    • Bryggeri
    • Firmagave
    Heldbred & Fitness
    • Sportsklub
    • Optiker
    • Fitnesscenter
    • Kosmetolog
    • Apotek
    • Frisør
    Håndværk
    • Handyman
    • IT-hardware og support
    • Solenergisystemer
    • Skomager
    • Rengøringsservicer
    • VVS- og ventilationsservice
    Andet
    • Nonprofitorganisation
    • Miljøagentur
    • Udlejning af billboards
    • Fotografi
    • Cykeludlejning
    • Softwareforhandler
    Gennemse alle brancher
  • Community
    Få mere at vide
    • Tutorials
    • Dokumentation
    • Certificeringer
    • Oplæring
    • Blog
    • Podcast
    Bliv klogere
    • Udannelselsesprogram
    • Scale Up!-virksomhedsspillet
    • Besøg Odoo
    Få softwaren
    • Download
    • Sammenlign versioner
    • Udgaver
    Samarbejde
    • Github
    • Forum
    • Arrangementer
    • Oversættelser
    • Bliv partner
    • Tjenester til partnere
    • Registrér dit regnskabsfirma
    Modtag tjenester
    • Find en partner
    • Find en bogholder
    • Kontakt en rådgiver
    • Implementeringstjenester
    • Kundereferencer
    • Support
    • Opgraderinger
    Github Youtube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Få en demo
  • Prissætning
  • Hjælp

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Bogføring
  • Lager
  • PoS
  • Projekt
  • MRP
All apps
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Hjælp

how develop report from 2 models Odoo 10

Tilmeld

Få besked, når der er aktivitet på dette indlæg

Dette spørgsmål er blevet anmeldt
2 Besvarelser
3523 Visninger
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
Kassér
Avatar
Sylvie
Forfatter Bedste svar

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
Kassér
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
Forfatter

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)
Bedste svar

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
Kassér
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Tilmeld dig
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Oversættelser
Tjenester
  • Odoo.sh-hosting
  • Support
  • Opgradere
  • Individuelt tilpasset udvikling
  • Uddannelse
  • Find en bogholder
  • Find en partner
  • Bliv partner
Om os
  • Vores virksomhed
  • Brandaktiver
  • Kontakt os
  • Stillinger
  • Arrangementer
  • Podcast
  • Blog
  • Kunder
  • Juridiske dokumenter • Privatlivspolitik
  • Sikkerhedspolitik
الْعَرَبيّة 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 er en samling open source-forretningsapps, der dækker alle dine virksomhedsbehov – lige fra CRM, e-handel og bogføring til lagerstyring, POS, projektledelse og meget mere.

Det unikke ved Odoo er, at systemet både er brugervenligt og fuldt integreret.

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