Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo course community database gettingstarted
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo course community database gettingstarted
Despre acest forum
  1. Getting Started
  2. Forum

Sub Total Per page

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
5 Răspunsuri
3400 Vizualizări
Imagine profil
SOUJIRO30

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

I need your help. Thank you!

0
Imagine profil
Abandonează
Deepa Venkatesh

Could you plz elaborate your query

SOUJIRO30
Autor

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>

Imagine profil
Francis Louie Del Rosario
Cel mai bun răspuns

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
Imagine profil
Abandonează
Imagine profil
Ludvig Auvens (lau)
Cel mai bun răspuns

Hi, 

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

0
Imagine profil
Abandonează
SOUJIRO30
Autor

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>

Enjoying the discussion? Don't just read, join in!

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

Înscrie-te
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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