Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

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

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

How to add details in information tab (pament widget) in odoo 10?

Subscribe

Get notified when there's activity on this post

This question has been flagged
paymentregisterpostodoo10
2 Replies
11762 Views
Avatar
MUHAMMED ASLAM

I add some fields in register payment

model:account.payment

When the validate button is pressed then it goes to account.invoice.
there is a text field payment widget.

when clicked the (i) symbolled tab then the information like memo,amount,date,payment method are displayed.

Question

My question is how to add custom fields cheque date,cheque no and bank in information tab?
Notes

when the validate button is clicked the post function is executed




0
Avatar
Discard
Avatar
Mohammed Amal N
Best Answer

Hello,

That is shown when a field is defined as a payment widget(as widget="payment")

Below I've posted the compute function for the paymets_info field

@api.one
@api.depends('payment_move_line_ids.amount_residual')
def _get_payment_info_JSON(self):
self.payments_widget = json.dumps(False)
if self.payment_move_line_ids:
info = {'title': _('Less Payment'), 'outstanding': False, 'content': []}
currency_id = self.currency_id
for payment in self.payment_move_line_ids:
payment_currency_id = False
if self.type in ('out_invoice', 'in_refund'):
amount = sum([p.amount for p in payment.matched_debit_ids if p.debit_move_id in self.move_id.line_ids])
amount_currency = sum([p.amount_currency for p in payment.matched_debit_ids if p.debit_move_id in self.move_id.line_ids])
if payment.matched_debit_ids:
payment_currency_id = all([p.currency_id == payment.matched_debit_ids[0].currency_id for p in payment.matched_debit_ids]) and payment.matched_debit_ids[0].currency_id or False
elif self.type in ('in_invoice', 'out_refund'):
amount = sum([p.amount for p in payment.matched_credit_ids if p.credit_move_id in self.move_id.line_ids])
amount_currency = sum([p.amount_currency for p in payment.matched_credit_ids if p.credit_move_id in self.move_id.line_ids])
if payment.matched_credit_ids:
payment_currency_id = all([p.currency_id == payment.matched_credit_ids[0].currency_id for p in payment.matched_credit_ids]) and payment.matched_credit_ids[0].currency_id or False
# get the payment value in invoice currency
if payment_currency_id and payment_currency_id == self.currency_id:
amount_to_show = amount_currency
else:
amount_to_show = payment.company_id.currency_id.with_context(date=payment.date).compute(amount, self.currency_id)
if float_is_zero(amount_to_show, precision_rounding=self.currency_id.rounding):
continue
payment_ref = payment.move_id.name
if payment.move_id.ref:
payment_ref += ' (' + payment.move_id.ref + ')'
info['content'].append({
'name': payment.name,
'journal_name': payment.journal_id.name,
'amount': amount_to_show,
'currency': currency_id.symbol,
'digits': [69, currency_id.decimal_places],
'position': currency_id.position,
'date': payment.date,
'payment_id': payment.id,
'move_id': payment.move_id.id,
'ref': payment_ref,
})
self.payments_widget = json.dumps(info)

You can add any field you want to it by changing real code or inheriting it and add value to content

Also you should change account_payment_widget.js and its corresponding qwebview(account_payment.xml)


3
Avatar
Discard
MUHAMMED ASLAM
Author

Thanks amal .Can you explain this?

Avatar
MUHAMMED ASLAM
Author Best Answer

Thanks Amal,

I have some queries.

in my custom module, i added this function add field in contest like this

'chq_no': payment.chq_no,

I also add this field in account.move.line and account.payment but the chqno value not there. I print the contest but there chq_no returns False.What is the problem is that.?

2)I added the xml and js files and from account module and added it to my custom module.

    added changes.can you js file called.?

0
Avatar
Discard
Mohammed Amal N

If you correctly pass values from js to the qweb then it should work.

Mohammed Amal N

You can try like adding <span>test</span> in your original qweb code to see the result

MUHAMMED ASLAM
Author

'chq_no':info.content[v].chq_no,

i add this line js. but not get the chq_no.

MUHAMMED ASLAM
Author

this i added in account_payment.xml.

<tr>

<td><strong>Cheque No: </strong></td>

<td style="text-align:right;"><t t-esc="chq_no"/></td>

</tr>

is anything wrong in my code?

MUHAMMED ASLAM
Author

i use ur above the test is in info tab.

i think the problem is in python function.

i print the contest but the chq_no returns False.

Can you explain what is the problem in that?

MUHAMMED ASLAM
Author

amal. I added the chq_no field account.payment in xml.

in python i also added that fields in account.payment and account.move.line.

but in _get_payment_info_JSON function we get the ids of account.move.line.

That's why chq_no is False.

What to make to get the value of chq_no in contest??

Mohammed Amal N

Add your value to info['content'] in py.

Then pass it through js to your qweb.

If you check account_payment_widget.js you can see how it is passed

MUHAMMED ASLAM
Author

thanks amal

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
payment acquirers
payment odoo10
Avatar
0
Dec 18
2330
Module 'Account Payment Mode' in Odoo 10. What is "Payment Method" and "Link to Bank Account"
payment odoo10
Avatar
0
Jul 18
5561
Error when register payment
partner payment register
Avatar
0
Dec 21
2646
Register Payment for my invoices malfunctioned Solved
payment amount register
Avatar
Avatar
Avatar
Avatar
Avatar
29
Dec 20
18257
PayTabs Payment Integration with Odoo Solved
integration payment odoo10
Avatar
1
Apr 19
1269
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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