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 accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

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

Abonare

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

Această întrebare a fost marcată
Odoo 17.0+e (Enterprise Edition)Print Batch Payment Report
1 Răspunde
1498 Vizualizări
Imagine profil
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
Imagine profil
Abandonează
Imagine profil
Cybrosys Techno Solutions Pvt.Ltd
Cel mai bun răspuns

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
Imagine profil
Abandonează
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
Related Posts Răspunsuri Vizualizări Activitate
How to Import Data on Previous Dates
Odoo 17.0+e (Enterprise Edition)
Imagine profil
0
nov. 25
333
Purchase and Inventory Unit of Measure
Odoo 17.0+e (Enterprise Edition)
Imagine profil
Imagine profil
Imagine profil
2
iun. 25
1679
Problem paying my Odoo Enterprise subscription.
Odoo 17.0+e (Enterprise Edition)
Imagine profil
Imagine profil
Imagine profil
2
mar. 25
1850
automated actions webhook custom payload or api call
api automatic-action Odoo 17.0+e (Enterprise Edition)
Imagine profil
0
mar. 25
2422
WHATSAPP VERIFY
integration WHATSAPP odoo 17 Odoo 17.0+e (Enterprise Edition)
Imagine profil
0
mar. 25
1559
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