Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

how develop report from 2 models Odoo 10

Odoberať

Get notified when there's activity on this post

This question has been flagged
2 Replies
3528 Zobrazenia
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
Zrušiť
Avatar
Sylvie
Autor Best Answer

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
Zrušiť
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)
Best Answer

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
Zrušiť
Enjoying the discussion? Don't just read, join in!

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

Registrácia
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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