Skip to Content
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Zatwierdzenia
    • IoT
    • VoIP
    • Baza wiedzy
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc

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

  • CRM
  • e-Commerce
  • Księgowość
  • Zapasy
  • PoS
  • Projekt
  • MRP
All apps
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo course community database gettingstarted
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo course community database gettingstarted
O tym forum
  1. Getting Started
  2. Forum

Sub Total Per page

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
5 Odpowiedzi
3388 Widoki
Awatar
SOUJIRO30

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

I need your help. Thank you!

0
Awatar
Odrzuć
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>

Awatar
Francis Louie Del Rosario
Najlepsza odpowiedź

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
Awatar
Odrzuć
Awatar
Ludvig Auvens (lau)
Najlepsza odpowiedź

Hi, 

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

0
Awatar
Odrzuć
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>

Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة 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 to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

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