Passa al contenuto
Odoo Menu
  • Accedi
  • Provalo gratis
  • App
    Finanze
    • Contabilità
    • Fatturazione
    • Note spese
    • Fogli di calcolo (BI)
    • Documenti
    • Firma
    Vendite
    • CRM
    • Vendite
    • Punto vendita Negozio
    • Punto vendita Ristorante
    • Abbonamenti
    • Noleggi
    Siti web
    • Configuratore sito web
    • E-commerce
    • Blog
    • Forum
    • Live chat
    • E-learning
    Supply chain
    • Magazzino
    • Produzione
    • PLM
    • Acquisti
    • Manutenzione
    • Qualità
    Risorse umane
    • Dipendenti
    • Assunzioni
    • Ferie
    • Valutazioni
    • Referral dipendenti
    • Parco veicoli
    Marketing
    • Social marketing
    • E-mail marketing
    • SMS marketing
    • Eventi
    • Marketing automation
    • Sondaggi
    Servizi
    • Progetti
    • Fogli ore
    • Assistenza sul campo
    • Helpdesk
    • Pianificazione
    • Appuntamenti
    Produttività
    • Comunicazioni
    • Approvazioni
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    App di terze parti Odoo Studio Piattaforma cloud Odoo
  • Settori
    Retail
    • Libreria
    • Negozio di abbigliamento
    • Negozio di arredamento
    • Alimentari
    • Ferramenta
    • Negozio di giocattoli
    Cibo e ospitalità
    • Bar e pub
    • Ristorante
    • Fast food
    • Pensione
    • Grossista di bevande
    • Hotel
    Agenzia immobiliare
    • Agenzia immobiliare
    • Studio di architettura
    • Edilizia
    • Gestione immobiliare
    • Impresa di giardinaggio
    • Associazione di proprietari immobiliari
    Consulenza
    • Società di contabilità
    • Partner Odoo
    • Agenzia di marketing
    • Studio legale
    • Selezione del personale
    • Audit e certificazione
    Produzione
    • Tessile
    • Metallo
    • Arredamenti
    • Alimentare
    • Birrificio
    • Ditta di regalistica aziendale
    Benessere e sport
    • Club sportivo
    • Negozio di ottica
    • Centro fitness
    • Centro benessere
    • Farmacia
    • Parrucchiere
    Commercio
    • Tuttofare
    • Hardware e assistenza IT
    • Ditta di installazione di pannelli solari
    • Calzolaio
    • Servizi di pulizia
    • Servizi di climatizzazione
    Altro
    • Organizzazione non profit
    • Ente per la tutela ambientale
    • Agenzia di cartellonistica pubblicitaria
    • Studio fotografico
    • Punto noleggio di biciclette
    • Rivenditore di software
    Carica tutti i settori
  • Community
    Apprendimento
    • Tutorial
    • Documentazione
    • Certificazioni 
    • Formazione
    • Blog
    • Podcast
    Potenzia la tua formazione
    • Programma educativo
    • Scale Up! Business Game
    • Visita Odoo
    Ottieni il software
    • Scarica
    • Versioni a confronto
    • Note di versione
    Collabora
    • Github
    • Forum
    • Eventi
    • Traduzioni
    • Diventa nostro partner
    • Servizi per partner
    • Registra la tua società di contabilità
    Ottieni servizi
    • Trova un partner
    • Trova un contabile
    • Incontra un esperto
    • Servizi di implementazione
    • Testimonianze dei clienti
    • Supporto
    • Aggiornamenti
    GitHub Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Richiedi una demo
  • Prezzi
  • Aiuto

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

  • CRM
  • e-Commerce
  • Contabilità
  • Magazzino
  • PoS
  • Progetti
  • MRP
All apps
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo course community database gettingstarted
Sul forum
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo course community database gettingstarted
Sul forum
  1. Getting Started
  2. Forum

Sub Total Per page

Iscriviti

Ricevi una notifica quando c'è un'attività per questo post

La domanda è stata contrassegnata
5 Risposte
3394 Visualizzazioni
Avatar
SOUJIRO30

How can I get the  subtotal per page of the records.?

I need your help. Thank you!

0
Avatar
Abbandona
Deepa Venkatesh

Could you plz elaborate your query

SOUJIRO30
Autore

here is my code

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

<odoo>

<data>

<!--Loan Summary Template-->

<template id="report_loan_summary_template">

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

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

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

<div class="page">

<!--<br/><br/><br/><br/>-->

<t t-set="company_ids" t-value="[]"/>

<t t-foreach="records.sorted(key=lambda r: r.employee_id.company_id.name)" t-as="recs">

<t t-set="company_ids" t-value="company_ids+[recs.employee_id.company_id]"/>

</t>

<t t-foreach="o.get_sorted(list(set(company_ids)))" t-as="company">

<div style="page-break-before:always;">

<t t-if="o.columns_of_two">

<t t-set="end" t-value="[1,2]"/>

</t>

<t t-if="not o.columns_of_two">

<t t-set="end" t-value="[1]"/>

</t>

<t t-foreach="end" t-as="e">

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

<!--<div class="text-center">-->

<!--<span style="font-weight:bold;font-family:Liberation Sans;font-size:16px;"><span class="text-uppercase" t-field="o.loan_type_id.name"/> SUMMARY<br/></span>-->

<!--&lt;!&ndash;<span style="font-weight:bold;font-family:Liberation Sans;font-size:16px;">LOAN SUMMARY LIST<br/></span>&ndash;&gt;-->

<!--<span style="font-weight:bold;font-family:Liberation Sans;font-size:10px;">FOR THE MONTH OF <span class="text-uppercase" t-esc="time.strftime('%B', time.strptime(o.from_date,'%Y-%m-%d'))"/><br/></span>-->

<!--&lt;!&ndash;<span><span t-esc="time.strftime('%B %d, %Y', time.strptime(o.from_date,'%Y-%m-%d'))"/> - <span t-esc="time.strftime('%B %d, %Y', time.strptime(o.to_date,'%Y-%m-%d'))"/></span>&ndash;&gt;-->

<!--</div><br/>-->

<!--<span style="font-weight:bold;font-family:Liberation Sans;font-size:12px;text-align:center;">Date: <span t-esc="context_timestamp(datetime.datetime.now()).strftime('%B %d, %Y %I:%M:%S %p')"/></span><br/>-->

<!--<t t-set="loan_type_ids" t-value="[]"/>-->

<!--<t t-foreach="records.sorted(key=lambda r: r.loan_type.name)" t-as="recs">-->

<!--<t t-set="loan_type_ids" t-value="loan_type_ids+[recs.loan_type]"/>-->

<!--</t>-->

<!--<t t-foreach="o.get_sorted(list(set(loan_type_ids)))" t-as="loan">-->

<!--<span style="font-weight:bold;font-family:Liberation Sans;font-size:14px;" class="text-uppercase"><span t-esc="loan.name"/></span><br/>-->

<table style="width:100%;text-align:center;font-family:Liberation Sans;border-collapse: collapse;">

<thead>

<tr>

<th colspan="5" style="width:100%;padding:8px;text-align:center;vertical-align:center;">

<div class="text-center">

<span style=";font-family:Liberation Sans;font-size:16px;" class="text-uppercase" t-esc="company.name"/><br/>

<span style="font-weight:bold;font-family:Liberation Sans;font-size:16px;"><span class="text-uppercase" t-field="o.loan_type_id.name"/> SUMMARY<br/></span>

<span style="font-weight:bold;font-family:Liberation Sans;font-size:10px;">FOR THE MONTH OF <span class="text-uppercase" t-esc="time.strftime('%B, %Y', time.strptime(o.from_date,'%Y-%m-%d'))"/><br/></span>

</div>

</th>

</tr>

<tr style="font-size:12;font-weight:bold;background-color:#d6d8db;text-align:center;border: 1px solid #000000;">

<th style="width:5%;padding:8px;text-align:center;vertical-align:center;border: 1px solid #000000;">ID NO.</th>

<th style="width:30%;padding:8px;text-align:center;vertical-align:center;border: 1px solid #000000;">EMPLOYEE'S NAME</th>

<th style="width:5%;padding:8px;text-align:center;vertical-align:center;border: 1px solid #000000;">15TH</th>

<th style="width:5%;padding:8px;text-align:center;vertical-align:center;border: 1px solid #000000;"><span t-esc="o.get_last_day_month(o.to_date)"/> </th>

<th style="width:5%;padding:8px;text-align:center;vertical-align:center;border: 1px solid #000000;">TOTAL</th>

</tr>

</thead>

<!--<t t-foreach="records.sorted(key=lambda r: r.employee_id.name)" t-as="rec">-->

<t t-set="employee_ids" t-value="[]"/>

<t t-foreach="records.sorted(key=lambda r: r.loan_id.employee_id)" t-as="recs">

<t t-if="recs.loan_id.employee_id.company_id.id == company.id">

<t t-set="employee_ids" t-value="employee_ids+[recs.loan_id.employee_id]"/>

</t>

</t>

<t t-foreach="o.get_sorted(list(set(employee_ids)))" t-as="employee">

<tbody>

<tr style="font-size:12px;">

<t t-set="loan_1" t-value="0"/>

<t t-set="loan_2" t-value="0"/>

<td style="width:5%;padding:8px;text-align:left;vertical-align:center;">

<span class="text-uppercase"><span t-esc="employee.identification_id"/></span>

</td>

<td style="width:30%;padding:8px;text-align:left;vertical-align:center;">

<span t-esc="employee.name"/>

</td>

<td style="width:5%;padding:8px;text-align:center;vertical-align:center;">

<t t-set="loan_1" t-value="0"/>

<t t-set="loan_1" t-value="sum([rec.paid_amount for rec in records if rec.loan_id.employee_id.id == employee.id and rec.loan_type_id.id == o.loan_type_id.id and rec.payroll_id.payslip_run_id.hr_period_id.vale_period == 1])"/>

<t t-esc="'{0:,.2f}'.format((loan_1))"/>

</td>

<td style="width:5%;padding:8px;text-align:center;vertical-align:center;">

<t t-set="loan_2" t-value="0"/>

<t t-set="loan_2" t-value="sum([rec.paid_amount for rec in records if rec.loan_id.employee_id.id == employee.id and rec.loan_type_id.id == o.loan_type_id.id and rec.payroll_id.payslip_run_id.hr_period_id.vale_period == 2])"/>

<t t-esc="'{0:,.2f}'.format((loan_2))"/>

</td>

<td style="width:5%;padding:8px;text-align:right;vertical-align:center;">

<span t-esc="'{0:,.2f}'.format(loan_2 + loan_1)"/>

</td>

</tr>

</tbody>

</t>

<tr>

<t t-set="total_loan_1" t-value="0"/>

<t t-set="total_loan_2" t-value="0"/>

<td style="vertical-align:center;text-align:center;padding:5px;border: 1px solid #000000;" colspan="2">

<strong><span>GRAND TOTAL</span></strong>

</td>

<td style="vertical-align:center;text-align:right;padding:5px;font-weight:bold;border: 1px solid #000000;">

<t t-set="total_loan_1" t-value="0"/>

<t t-set="total_loan_1" t-value="sum([rec.paid_amount for rec in records if rec.loan_type_id.id == o.loan_type_id.id and rec.payroll_id.payslip_run_id.hr_period_id.vale_period == 1])"/>

<t t-esc="'{0:,.2f}'.format((total_loan_1))"/>

</td>

<td style="vertical-align:center;text-align:right;padding:5px;font-weight:bold;border: 1px solid #000000;">

<t t-set="total_loan_2" t-value="0"/>

<t t-set="total_loan_2" t-value="sum([rec.paid_amount for rec in records if rec.loan_type_id.id == o.loan_type_id.id and rec.payroll_id.payslip_run_id.hr_period_id.vale_period == 2])"/>

<t t-esc="'{0:,.2f}'.format((total_loan_2))"/>

</td>

<td style="vertical-align:center;text-align:right;padding:5px;font-weight:bold;border: 1px solid #000000;">

<t t-esc="'{0:,.2f}'.format((total_loan_1 + total_loan_2))"/>

</td>

</tr>

</table><br/>

</div>

</t>

</div>

</t>

</div>

<div class="footer">

<i>

<div class="text-left">

<span style="font-size:12px;"><i>Date printed: <span t-esc="context_timestamp(datetime.datetime.now()).strftime('%B %d, %Y %I:%M:%S %p')"/></i></span>

</div>

<div class="text-center">

<ul class="list-inline">

<li>Page:</li>

<li><span class="page"/></li>

<li>/</li>

<li><span class="topage"/></li>

</ul>

</div>

</i>

</div>

</t>

</t>

</template>

</data>

</odoo>

Avatar
Francis Louie Del Rosario
Risposta migliore

Hello SOUJIRO30,

is this a qweb report?

i think you need a "for-loop" inside of qweb, and you should know what object inside that page and get the data.

you can add multiple 




0
Avatar
Abbandona
Avatar
Ludvig Auvens (lau)
Risposta migliore

Hi, 

In order to help you, could you give us more details about your problem?

0
Avatar
Abbandona
SOUJIRO30
Autore

here is my code, I hope you can help me.

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

<odoo>

<data>

<!--Loan Summary Template-->

<template id="report_loan_summary_template">

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

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

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

<div class="page">

<!--<br/><br/><br/><br/>-->

<t t-set="company_ids" t-value="[]"/>

<t t-foreach="records.sorted(key=lambda r: r.employee_id.company_id.name)" t-as="recs">

<t t-set="company_ids" t-value="company_ids+[recs.employee_id.company_id]"/>

</t>

<t t-foreach="o.get_sorted(list(set(company_ids)))" t-as="company">

<div style="page-break-before:always;">

<t t-if="o.columns_of_two">

<t t-set="end" t-value="[1,2]"/>

</t>

<t t-if="not o.columns_of_two">

<t t-set="end" t-value="[1]"/>

</t>

<t t-foreach="end" t-as="e">

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

<!--<div class="text-center">-->

<!--<span style="font-weight:bold;font-family:Liberation Sans;font-size:16px;"><span class="text-uppercase" t-field="o.loan_type_id.name"/> SUMMARY<br/></span>-->

<!--&lt;!&ndash;<span style="font-weight:bold;font-family:Liberation Sans;font-size:16px;">LOAN SUMMARY LIST<br/></span>&ndash;&gt;-->

<!--<span style="font-weight:bold;font-family:Liberation Sans;font-size:10px;">FOR THE MONTH OF <span class="text-uppercase" t-esc="time.strftime('%B', time.strptime(o.from_date,'%Y-%m-%d'))"/><br/></span>-->

<!--&lt;!&ndash;<span><span t-esc="time.strftime('%B %d, %Y', time.strptime(o.from_date,'%Y-%m-%d'))"/> - <span t-esc="time.strftime('%B %d, %Y', time.strptime(o.to_date,'%Y-%m-%d'))"/></span>&ndash;&gt;-->

<!--</div><br/>-->

<!--<span style="font-weight:bold;font-family:Liberation Sans;font-size:12px;text-align:center;">Date: <span t-esc="context_timestamp(datetime.datetime.now()).strftime('%B %d, %Y %I:%M:%S %p')"/></span><br/>-->

<!--<t t-set="loan_type_ids" t-value="[]"/>-->

<!--<t t-foreach="records.sorted(key=lambda r: r.loan_type.name)" t-as="recs">-->

<!--<t t-set="loan_type_ids" t-value="loan_type_ids+[recs.loan_type]"/>-->

<!--</t>-->

<!--<t t-foreach="o.get_sorted(list(set(loan_type_ids)))" t-as="loan">-->

<!--<span style="font-weight:bold;font-family:Liberation Sans;font-size:14px;" class="text-uppercase"><span t-esc="loan.name"/></span><br/>-->

<table style="width:100%;text-align:center;font-family:Liberation Sans;border-collapse: collapse;">

<thead>

<tr>

<th colspan="5" style="width:100%;padding:8px;text-align:center;vertical-align:center;">

<div class="text-center">

<span style=";font-family:Liberation Sans;font-size:16px;" class="text-uppercase" t-esc="company.name"/><br/>

<span style="font-weight:bold;font-family:Liberation Sans;font-size:16px;"><span class="text-uppercase" t-field="o.loan_type_id.name"/> SUMMARY<br/></span>

<span style="font-weight:bold;font-family:Liberation Sans;font-size:10px;">FOR THE MONTH OF <span class="text-uppercase" t-esc="time.strftime('%B, %Y', time.strptime(o.from_date,'%Y-%m-%d'))"/><br/></span>

</div>

</th>

</tr>

<tr style="font-size:12;font-weight:bold;background-color:#d6d8db;text-align:center;border: 1px solid #000000;">

<th style="width:5%;padding:8px;text-align:center;vertical-align:center;border: 1px solid #000000;">ID NO.</th>

<th style="width:30%;padding:8px;text-align:center;vertical-align:center;border: 1px solid #000000;">EMPLOYEE'S NAME</th>

<th style="width:5%;padding:8px;text-align:center;vertical-align:center;border: 1px solid #000000;">15TH</th>

<th style="width:5%;padding:8px;text-align:center;vertical-align:center;border: 1px solid #000000;"><span t-esc="o.get_last_day_month(o.to_date)"/> </th>

<th style="width:5%;padding:8px;text-align:center;vertical-align:center;border: 1px solid #000000;">TOTAL</th>

</tr>

</thead>

<!--<t t-foreach="records.sorted(key=lambda r: r.employee_id.name)" t-as="rec">-->

<t t-set="employee_ids" t-value="[]"/>

<t t-foreach="records.sorted(key=lambda r: r.loan_id.employee_id)" t-as="recs">

<t t-if="recs.loan_id.employee_id.company_id.id == company.id">

<t t-set="employee_ids" t-value="employee_ids+[recs.loan_id.employee_id]"/>

</t>

</t>

<t t-foreach="o.get_sorted(list(set(employee_ids)))" t-as="employee">

<tbody>

<tr style="font-size:12px;">

<t t-set="loan_1" t-value="0"/>

<t t-set="loan_2" t-value="0"/>

<td style="width:5%;padding:8px;text-align:left;vertical-align:center;">

<span class="text-uppercase"><span t-esc="employee.identification_id"/></span>

</td>

<td style="width:30%;padding:8px;text-align:left;vertical-align:center;">

<span t-esc="employee.name"/>

</td>

<td style="width:5%;padding:8px;text-align:center;vertical-align:center;">

<t t-set="loan_1" t-value="0"/>

<t t-set="loan_1" t-value="sum([rec.paid_amount for rec in records if rec.loan_id.employee_id.id == employee.id and rec.loan_type_id.id == o.loan_type_id.id and rec.payroll_id.payslip_run_id.hr_period_id.vale_period == 1])"/>

<t t-esc="'{0:,.2f}'.format((loan_1))"/>

</td>

<td style="width:5%;padding:8px;text-align:center;vertical-align:center;">

<t t-set="loan_2" t-value="0"/>

<t t-set="loan_2" t-value="sum([rec.paid_amount for rec in records if rec.loan_id.employee_id.id == employee.id and rec.loan_type_id.id == o.loan_type_id.id and rec.payroll_id.payslip_run_id.hr_period_id.vale_period == 2])"/>

<t t-esc="'{0:,.2f}'.format((loan_2))"/>

</td>

<td style="width:5%;padding:8px;text-align:right;vertical-align:center;">

<span t-esc="'{0:,.2f}'.format(loan_2 + loan_1)"/>

</td>

</tr>

</tbody>

</t>

<tr>

<t t-set="total_loan_1" t-value="0"/>

<t t-set="total_loan_2" t-value="0"/>

<td style="vertical-align:center;text-align:center;padding:5px;border: 1px solid #000000;" colspan="2">

<strong><span>GRAND TOTAL</span></strong>

</td>

<td style="vertical-align:center;text-align:right;padding:5px;font-weight:bold;border: 1px solid #000000;">

<t t-set="total_loan_1" t-value="0"/>

<t t-set="total_loan_1" t-value="sum([rec.paid_amount for rec in records if rec.loan_type_id.id == o.loan_type_id.id and rec.payroll_id.payslip_run_id.hr_period_id.vale_period == 1])"/>

<t t-esc="'{0:,.2f}'.format((total_loan_1))"/>

</td>

<td style="vertical-align:center;text-align:right;padding:5px;font-weight:bold;border: 1px solid #000000;">

<t t-set="total_loan_2" t-value="0"/>

<t t-set="total_loan_2" t-value="sum([rec.paid_amount for rec in records if rec.loan_type_id.id == o.loan_type_id.id and rec.payroll_id.payslip_run_id.hr_period_id.vale_period == 2])"/>

<t t-esc="'{0:,.2f}'.format((total_loan_2))"/>

</td>

<td style="vertical-align:center;text-align:right;padding:5px;font-weight:bold;border: 1px solid #000000;">

<t t-esc="'{0:,.2f}'.format((total_loan_1 + total_loan_2))"/>

</td>

</tr>

</table><br/>

</div>

</t>

</div>

</t>

</div>

<div class="footer">

<i>

<div class="text-left">

<span style="font-size:12px;"><i>Date printed: <span t-esc="context_timestamp(datetime.datetime.now()).strftime('%B %d, %Y %I:%M:%S %p')"/></i></span>

</div>

<div class="text-center">

<ul class="list-inline">

<li>Page:</li>

<li><span class="page"/></li>

<li>/</li>

<li><span class="topage"/></li>

</ul>

</div>

</i>

</div>

</t>

</t>

</template>

</data>

</odoo>

Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!

Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!

Registrati
Community
  • Tutorial
  • Documentazione
  • Forum
Open source
  • Scarica
  • Github
  • Runbot
  • Traduzioni
Servizi
  • Hosting Odoo.sh
  • Supporto
  • Aggiornamenti
  • Sviluppi personalizzati
  • Formazione
  • Trova un contabile
  • Trova un partner
  • Diventa nostro partner
Chi siamo
  • La nostra azienda
  • Branding
  • Contattaci
  • Lavora con noi
  • Eventi
  • Podcast
  • Blog
  • Clienti
  • Note legali • Privacy
  • Sicurezza
الْعَرَبيّة 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 è un gestionale di applicazioni aziendali open source pensato per coprire tutte le esigenze della tua azienda: CRM, Vendite, E-commerce, Magazzino, Produzione, Fatturazione elettronica, Project Management e molto altro.

Il punto di forza di Odoo è quello di offrire un ecosistema unico di app facili da usare, intuitive e completamente integrate tra loro.

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