Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Diskusi
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

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

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

How to display Payment Date as a field in Inovice List View - Accounting App

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
accountinginvoicereportpaymentsv15
3 Replies
4023 Tampilan
Avatar
Naz

Hi,

 

All I need to do is (in Odoo 15 web):

 

When we make payment in Register Payment,

 

We get this Payment date right?

 

I need this payment date as a field, in accounting app > customers > Invoices(List view) with data being populated. 


So that, I would know when the payment is made.

 

If it is possible, kindly guide me with,


Thank You in Advance.
Email: nazeersaleem385@gmail.com


0
Avatar
Buang
Avatar
Renata Carrillo
Jawaban Terbai

Hello, Naz.
Você pode fazer o seguinte (eu fiz e deu certo):
01) With Studio, create a Date type field in account.move [x_studio_data_de_pagamento_1] (and make it visible only when the entry type is equal to "Vendor Invoice": move_type != "in_invoice");

02) Add it to the tree view;

03) Create an automation with python code in Base Automation so that we can take the value of the 'date' field in account.payment and assign it to this field created with Studio, as follows:

for record in records:

    # Check if the payment state is 'not_paid'

    if record.payment_state == 'not_paid':

        # If the payment state is 'not_paid', clear the field 'x_studio_data_de_pagamento_1'

        record.update({'x_studio_data_de_pagamento_1': False})

    else:

        # Check if the invoice has associated payments

        if record.invoice_payments_widget:

            payments = record.invoice_payments_widget.get('content')

            dates = []

            for payment_info in payments:

                # Extract the payment date

                payment = payment_info.get('date', '')

                if payment:  # Add the date only if it is present

                    # Check if 'payment' is of type datetime.date

                    if isinstance(payment, datetime.date):

                        # Format the date in D/M/Y (Day/Month/Year) for display

                        formatted_date = payment.strftime('%d/%m/%Y')

                        dates.append(formatted_date)  # Use the formatted date

                    else:

                        # Otherwise, assume that 'payment' is a string in the format 'YYYY-MM-DD'

                        formatted_date = payment.split("-")

                        formatted_date = f"{formatted_date[2]}/{formatted_date[1]}/{formatted_date[0]}"

                        dates.append(formatted_date)  # Use the formatted date

            # Update the field 'x_studio_data_de_pagamento_1' with the first payment date

            if dates:  # Check if there are dates to update

                # The first payment date (in 'DD/MM/YYYY' format) will be converted to 'Date' without using fields

                first_payment_date_str = dates[0]  # Example: "26/03/2025"

                try:

                    # Converting the string 'DD/MM/YYYY' to the format 'YYYY-MM-DD'

                    day, month, year = first_payment_date_str.split('/')

                    first_payment_date = f"{year}-{month}-{day}"  # Format 'YYYY-MM-DD'

                    record.update({'x_studio_data_de_pagamento_1': first_payment_date})

                except ValueError:

                    # In case of conversion error, clear the field 'x_studio_data_de_pagamento_1'

                    record.update({'x_studio_data_de_pagamento_1': False})

            else:

                # If there are no dates, clear the field 'x_studio_data_de_pagamento_1'

                record.update({'x_studio_data_de_pagamento_1': False})

In my case, I needed to convert the date presentation to the Brazilian format, but you do not need to include this part of the code in your automation.

0
Avatar
Buang
Avatar
Naz
Penulis Jawaban Terbai

Hi Mily Shajan,

Thanks for your response. 

am working on odoo 15 web studio, above mentioned code did not work for me but using that code i have modified as per need. The modified code works well for me, i have created a field (date) and include that in my list view and i created one 'automated action' for 'model journal entry', i set trigger for 'on update' and triggers field is 'payment status' and action to do is 'execute python code' this is what i did, I will give that code here :

all_records = env['account.move'].search([])

#model name -> env['account.move']
#to get all the records ->  .search([])

for rec in all_records:    
if rec.payment_state == 'paid':        
​if rec.invoice_payments_widget:
​ ​try:                
​ ​ ​# Parse the JSON string into a dictionary                ​ ​ ​ ​ ​
​ ​ ​invoice_payments_widget_dict = json.loads(rec.invoice_payments_widget)                                
​ ​ ​# Access the required information                
​ ​ ​content_list = invoice_payments_widget_dict.get('content', [])                                
​ ​ ​if content_list:                    
​ ​ ​ ​content_data = content_list[0]                    
​ ​ ​ ​date_str = content_data.get('date', '')                                        
​ ​ ​ ​if date_str:                        
​ ​ ​ ​ ​rec['x_studio_date_field_a1MrW'] = date_str            
​ ​except Exception:                
​ ​ ​rec['x_studio_date_field_a1MrW'] = None

(Please check the indentation) 
 

0
Avatar
Buang
Avatar
Mily Shajan
Jawaban Terbai

Hi Naz

Create a field payment_date in the 'account. move' model  and compute the value 

Try the following code 

class AccountMoveInherit(models.Model):
_inherit = 'account.move'

payment_date = fields.Char(compute='_compute_payment_date')

def _compute_payment_date(self):
self.payment_date = False
for inv in self:
dates = []
if inv.invoice_payments_widget:
payment = inv.invoice_payments_widget.get('content')
for payment_info in payment:
dates.append(str(payment_info.get('date', '')))
inv.payment_date = ', '.join(dates)


Inherit the tree view of the Invoices 'view_out_invoice_tree' and add this field 


Regards


0
Avatar
Buang
Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
How to display Payment Date as a field in Inovice List View - Accounting App
accounting invoice payments v15
Avatar
Avatar
Avatar
Avatar
4
Jan 24
4754
Add Payment Date field in Accounting Invoice view
accounting invoice payments v15
Avatar
Avatar
1
Nov 25
3956
Adding Payment Details to Invoice Reports
invoice report payments
Avatar
Avatar
Avatar
2
Feb 25
2684
Add total no of quantities in the invoice report in odoo 17
accounting invoice report
Avatar
Avatar
Avatar
2
Apr 24
3607
Get this user error "Cannot create unbalanced journal entry." when i write 'quantity' or 'price_unit' in invoice_line_ids
accounting invoice v15
Avatar
Avatar
Avatar
2
Apr 24
2445
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة 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 adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik Odoo.

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