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 to change the Sort Order on the Print Batch Payment Report

Odoberať

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 Odpoveď
1503 Zobrazenia
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
Zrušiť
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
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
Related Posts Replies Zobrazenia Aktivita
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
jún 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
2431
WHATSAPP VERIFY
integration WHATSAPP odoo 17 Odoo 17.0+e (Enterprise Edition)
Avatar
0
mar 25
1561
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