Skip to Content
Odoo मेन्यू
  • Sign in
  • मुफ़्त में आज़माएं
  • ऐप्लिकेशन
    फ़ाइनेंस
    • अकाउंटिंग
    • इनवॉइसिंग
    • एक्सपेंस
    • स्प्रेडशीट (बीआई)
    • डॉक्यूमेंट्स
    • साइन
    सेल्स
    • सीआरएम
    • सेल्स
    • पीओएस शॉप
    • पीओएस रेस्टोरेंट
    • सब्सक्रिप्शन
    • रेंटल
    वेबसाइट
    • वेबसाइट बिल्डर
    • ई-कॉमर्स
    • ब्लॉग
    • फ़ोरम
    • लाइव चैट
    • ई-लर्निंग
    सप्लाई चेन
    • इन्वेंट्री
    • मैन्युफ़ैक्चरिंग
    • पीएलएम
    • परचेज़
    • मेंटेनेंस
    • क्वालिटी
    मानव संसाधन
    • कर्मचारी
    • रिक्रूटमेंट
    • टाइम ऑफ़
    • अप्रेज़ल
    • रेफ़रल
    • फ़्लीट
    मार्केटिंग
    • सोशल मार्केटिंग
    • ईमेल मार्केटिंग
    • एसएमएस मार्केटिंग
    • इवेंट
    • मार्केटिंग ऑटोमेशन
    • सर्वे
    सेवाएं
    • प्रोजेक्ट
    • टाइमशीट
    • फ़ील्ड सर्विस
    • हेल्पडेस्क
    • प्लानिंग
    • अपॉइंटमेंट
    प्रॉडक्टिविटी
    • डिस्कस
    • अप्रूवल
    • आईओटी
    • वीओआईपी
    • नॉलेज
    • WhatsApp
    तीसरे पक्ष के ऐप्लिकेशन Odoo स्टूडियो Odoo क्लाउड प्लेटफ़ॉर्म
  • इंडस्ट्री
    रीटेल
    • बुक स्टोर
    • क्लोदिंग स्टोर
    • फ़र्नीचर स्टोर
    • ग्रॉसरी स्टोर
    • हार्डवेयर स्टोर
    • टॉय स्टोर
    Food & Hospitality
    • बार और पब
    • रेस्टोरेंट
    • फ़ास्ट फ़ूड
    • Guest House
    • बेवरिज डिस्ट्रीब्यूटर
    • होटल
    रियल एस्टेट
    • Real Estate Agency
    • आर्किटेक्चर फ़र्म
    • कंसट्रक्शन
    • एस्टेट मैनेजमेंट
    • गार्ड्निंग
    • प्रॉपर्टी ओनर असोसिएशन
    कंसल्टिंग
    • अकाउंटिंग फ़र्म
    • Odoo पार्टनर
    • मार्केटिंग एजेंसी
    • लॉ फ़र्म
    • टैलेंट ऐक्विज़िशन
    • ऑडिट & सर्टिफ़िकेशन
    मैन्युफ़ैक्चरिंग
    • टेक्सटाइल
    • Metal
    • फ़र्नीचर
    • फ़ूड
    • Brewery
    • कॉर्पोरेट गिफ़्ट
    हेल्थ & फिटनेस
    • स्पोर्ट्स क्लब
    • आईवियर स्टोर
    • फिटनेस सेंटर
    • वेलनेस प्रैक्टिशनर
    • फॉर्मेसी
    • हेयर सैलून
    Trades
    • Handyman
    • आईटी हॉर्डवेयर और सपोर्ट
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    अन्य
    • Nonprofit Organization
    • एन्वायरमेंटल एजेंसी
    • बिलबोर्ड रेंटल
    • फ़ोटोग्राफी
    • बाइक लीजिंग
    • सॉफ़्टवेयर रीसेलर
    Browse all Industries
  • कम्यूनिटी
    सीखें
    • ट्यूटोरियल्स
    • दस्तावेज़
    • सर्टिफ़िकेशन
    • ट्रेनिंग
    • ब्लॉग
    • पॉडकास्ट
    शिक्षा को बढ़ावा दें
    • एजुकेशन प्रोग्राम
    • स्केल अप! बिजनेस गेम
    • Odoo के ऑफ़िस में आएं
    सॉफ़्टवेयर पाएं
    • डाउनलोड
    • वर्शन की तुलना करें
    • रिलीज़
    साथ मिलकर काम करें
    • Github
    • फ़ोरम
    • इवेंट
    • अनुवाद
    • पार्टनर बनें
    • Services for Partners
    • अपना अकाउंटिंग फ़र्म रजिस्टर करें
    सेवाएं पाएं
    • पार्टनर ढूंढें
    • अकाउंटेंट खोजें
    • सलाहकार की मदद लें
    • इम्प्लिमेंटेशन सेवाएं
    • कस्टमर रेफ़रेंस
    • सहायता
    • अपग्रेड
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    डेमो देखें
  • कीमत
  • सहायता

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

  • सीआरएम
  • e-Commerce
  • लेखांकन
  • इन्वेंटरी
  • PoS
  • प्रोजेक्ट
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
टैग (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
टैग (View all)
odoo accounting v14 pos v15
About this forum
Help

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

Subscribe

Get notified when there's activity on this post

This question has been flagged
accountinginvoicereportpaymentsv15
3 Replies
4015 Views
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
Discard
Avatar
Renata Carrillo
Best Answer

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
Discard
Avatar
Naz
Author Best Answer

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
Discard
Avatar
Mily Shajan
Best Answer

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
Discard
Enjoying the discussion? Don't just read, join in!

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

Sign up
Related Posts Replies Views Activity
How to display Payment Date as a field in Inovice List View - Accounting App
accounting invoice payments v15
Avatar
Avatar
Avatar
Avatar
4
जन॰ 24
4752
Add Payment Date field in Accounting Invoice view
accounting invoice payments v15
Avatar
Avatar
1
नव॰ 25
3952
Adding Payment Details to Invoice Reports
invoice report payments
Avatar
Avatar
Avatar
2
फ़र॰ 25
2675
Add total no of quantities in the invoice report in odoo 17
accounting invoice report
Avatar
Avatar
Avatar
2
अप्रैल 24
3605
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
अप्रैल 24
2442
कम्यूनिटी
  • ट्यूटोरियल्स
  • दस्तावेज़
  • फ़ोरम
ओपन सोर्स
  • डाउनलोड
  • Github
  • रनबॉट
  • अनुवाद
सेवाएं
  • Odoo.sh Hosting
  • सहायता
  • अपग्रेड
  • कस्टम डेवलपमेंट्स
  • शिक्षा
  • अकाउंटेंट खोजें
  • पार्टनर ढूंढें
  • पार्टनर बनें
हमारे बारे में
  • हमारी कंपनी
  • ब्रांड ऐसेट
  • संपर्क करें
  • नौकरियां
  • इवेंट
  • पॉडकास्ट
  • ब्लॉग
  • ग्राहक
  • लीगल • गोपनीयता
  • सुरक्षा
الْعَرَبيّة 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, बिज़नेस से जुड़े ऐप्लिकेशन का एक कलेक्शन है जो ओपन सोर्स पर आधारित है. इसमें आपकी कंपनी की हर ज़रूरत के लिए ऐप्लिकेशन हैं. जैसे, सीआरएम, ई-कॉमर्स, अकाउंटिंग, इन्वेंट्री, पॉइंट ऑफ़ सेल, प्रोजेक्ट मैनेजमेंट वगैरह.

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