Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Aplikacije
    Finance
    • Knjigovodstvo
    • Obračun
    • Stroški
    • Spreadsheet (BI)
    • Dokumenti
    • Podpisovanje
    Prodaja
    • CRM
    • Prodaja
    • POS Shop
    • POS Restaurant
    • Naročnine
    • Najem
    Spletne strani
    • Website Builder
    • Spletna trgovina
    • Blog
    • Forum
    • Pogovor v živo
    • eUčenje
    Dobavna veriga
    • Zaloga
    • Proizvodnja
    • PLM
    • Nabava
    • Vzdrževanje
    • Kakovost
    Kadri
    • Kadri
    • Kadrovanje
    • Odsotnost
    • Ocenjevanja
    • Priporočila
    • Vozni park
    Marketing
    • Družbeno Trženje
    • Email Marketing
    • SMS Marketing
    • Dogodki
    • Avtomatizacija trženja
    • Ankete
    Storitve
    • Projekt
    • Časovnice
    • Storitve na terenu
    • Služba za pomoč
    • Načrtovanje
    • Termini
    Produktivnost
    • Razprave
    • Odobritve
    • IoT
    • Voip
    • Znanje
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industrije
    Trgovina na drobno
    • Book Store
    • Trgovina z oblačili
    • Trgovina s pohištvom
    • Grocery Store
    • Trgovina s strojno opremo računalnikov
    • Trgovina z igračami
    Food & Hospitality
    • Bar and Pub
    • Restavracija
    • Hitra hrana
    • Guest House
    • Beverage Distributor
    • Hotel
    Nepremičnine
    • Real Estate Agency
    • Arhitekturno podjetje
    • Gradbeništvo
    • Estate Management
    • Vrtnarjenje
    • Združenje lastnikov nepremičnin
    Svetovanje
    • Računovodsko podjetje
    • Odoo Partner
    • Marketinška agencija
    • Law firm
    • Pridobivanje talentov
    • Audit & Certification
    Proizvodnja
    • Tekstil
    • Metal
    • Pohištvo
    • Hrana
    • Brewery
    • Poslovna darila
    Health & Fitness
    • Športni klub
    • Trgovina z očali
    • Fitnes center
    • Wellness Practitioners
    • Lekarna
    • Frizerski salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Sistemi sončne energije
    • Izdelovalec čevljev
    • Čistilne storitve
    • HVAC Services
    Ostali
    • Neprofitna organizacija
    • Agencija za okolje
    • Najem oglasnih panojev
    • Fotografija
    • Najem koles
    • Prodajalec programske opreme
    Browse all Industries
  • Skupnost
    Learn
    • Tutorials
    • Dokumentacija
    • Certifikati
    • Šolanje
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Prenesi
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Dogodki
    • Prevodi
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Sklici kupca
    • Podpora
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Določanje cen
  • Pomoč

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

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

How to change the Sort Order on the Print Batch Payment Report

Naroči se

Get notified when there's activity on this post

This question has been flagged
Odoo 17.0+e (Enterprise Edition)Print Batch Payment Report
1 Odgovori
1504 Prikazi
Avatar
Tammie Morris

The Default Batch payment report appears to sort itself based on the Payment Journal ID Number, How do I change this so it sorts by Customer / Vendor A-Z?

I assume the 3rd line    <t t-foreach="docs" t-as="o"> needs a 'sorted' command but I have no idea on the python / Odoo code.

Any help & guidance is most appreciated!


t-name="account_batch_payment.print_batch_payment">

    <t t-call="web.basic_layout">

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

            <div class="page page_batch_payment">

                <div class="oe_structure"/>

                <div class="row batch_details">

                    <div class="col-6"><span t-out="o.journal_id.company_id.name">Odoo Payments LLC</span></div>

                    <div class="col-6 text-end"><span t-out="o.journal_id.name">Bank Transfer</span> : <span t-out="o.name">Monthly Payment</span></div>

                </div>

                <div class="oe_structure"/>

                <div class="row batch_details">

                    <div class="col-6"><span t-out="o.date">2023-08-14</span></div>

                </div>

                <div class="oe_structure"/>

                <div class="row batch_details">

                    <div t-if="o.journal_id.bank_acc_number" class="col-6" style="font-size:18px;">Issuing bank account : <span t-out="o.journal_id.bank_acc_number">3956012345678</span></div>

                </div>

                <div class="oe_structure"/>

                <table class="table table-bordered table-sm">

                    <thead>

                        <tr>

                            <th class="text-start">Customer</th>

                            <th class="text-start">Date</th>

                            <th class="text-start">Memo</th>

                            <th class="text-start">Recipient Bank Account</th>

                            <th class="text-end">Amount</th>

                        </tr>

                    </thead>

                    <tr t-foreach="o.payment_ids" t-as="payment">

                        <td class="text-start"><span t-out="payment.partner_id.name">ABC Suppliers</span></td>

                        <td class="text-start"><span t-out="payment.date" t-options="{&quot;widget&quot;: &quot;date&quot;}">2023-08-15</span></td>

                        <td class="text-start"><span t-out="payment.ref">Demo Ref</span></td>

                        <td class="text-start"><span t-out="payment.partner_bank_id.acc_number">3956012345678</span></td>

                        <td class="text-end"><span t-out="payment.amount" t-options="{'widget': 'monetary', 'display_currency': payment.currency_id}">$1000.0</span></td>

                    </tr>

                    <tr>

                        <td style="font-weight: bold;">TOTAL</td>

                        <td/>

                        <td/>

                        <td/>

                        <td class="text-end" style="font-weight: bold;"><span t-out="o.amount" t-options="{'widget': 'monetary', 'display_currency': o.currency_id}">$1000.0</span></td>

                    </tr>

                </table>

                <div class="oe_structure"/>

            </div>

        </t>

    </t>

0
Avatar
Opusti
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

Hi,


You're absolutely right — the default account_batch_payment report in Odoo does not sort payments by partner name; it simply displays them in the order they're linked to the batch (usually by payment ID, hence indirectly sorted by journal ID).


To sort the payments alphabetically by Customer/Vendor name, you can apply a sorted() call in the template.


Try with the following code.


<tr t-foreach="sorted(o.payment_ids, key=lambda p: p.partner_id.name)" t-as="payment">

    <td class="text-start"><span t-out="payment.partner_id.name"/></td>

    <td class="text-start"><span t-out="payment.date" t-options="{ 'widget': 'date' }"/></td>

    <td class="text-start"><span t-out="payment.ref"/></td>

    <td class="text-start"><span t-out="payment.partner_bank_id.acc_number"/></td>

    <td class="text-end">

        <span t-out="payment.amount" t-options="{ 'widget': 'monetary', 'display_currency': payment.currency_id }"/>

    </td>

</tr>



This will alphabetically sort the payments shown in each batch by partner name (Customer/Vendor).


- If any payment.partner_id.name is empty or null, it will appear first in the sorted list.


-Ensure the report uses t-call="web.basic_layout" or similar to get full Python environment access, which supports sorted() in QWeb.



Hope it helps

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

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

Prijavi
Related Posts Odgovori Prikazi Aktivnost
How to Import Data on Previous Dates
Odoo 17.0+e (Enterprise Edition)
Avatar
0
nov. 25
341
Purchase and Inventory Unit of Measure
Odoo 17.0+e (Enterprise Edition)
Avatar
Avatar
Avatar
2
jun. 25
1684
Problem paying my Odoo Enterprise subscription.
Odoo 17.0+e (Enterprise Edition)
Avatar
Avatar
Avatar
2
mar. 25
1853
automated actions webhook custom payload or api call
api automatic-action Odoo 17.0+e (Enterprise Edition)
Avatar
0
mar. 25
2432
WHATSAPP VERIFY
integration WHATSAPP odoo 17 Odoo 17.0+e (Enterprise Edition)
Avatar
0
mar. 25
1561
Community
  • Tutorials
  • Dokumentacija
  • Forum
Open Source
  • Prenesi
  • Github
  • Runbot
  • Prevodi
Services
  • Odoo.sh Hosting
  • Podpora
  • Nadgradnja
  • Custom Developments
  • Izobraževanje
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Sredstva blagovne znamke
  • Kontakt
  • Zaposlitve
  • Dogodki
  • Podcast
  • Blog
  • Stranke
  • Pravno • Zasebnost
  • Varnost
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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