Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Aplikacije
    Finance
    • Knjigovodstvo
    • Obračun
    • Stroški
    • Spreadsheet (BI)
    • Dokumenti
    • Podpisovanje
    Prodaja
    • CRM
    • Prodaja
    • POS Shop
    • POS Restaurant
    • Naročnine
    • Najem
    Spletne strani
    • Website Builder
    • Spletna trgovina
    • Blog
    • Forum
    • Pogovor v živo
    • eUčenje
    Dobavna veriga
    • Zaloga
    • Proizvodnja
    • PLM
    • Nabava
    • Vzdrževanje
    • Kakovost
    Kadri
    • Kadri
    • Kadrovanje
    • Odsotnost
    • Ocenjevanja
    • Priporočila
    • Vozni park
    Marketing
    • Družbeno Trženje
    • Email Marketing
    • SMS Marketing
    • Dogodki
    • Avtomatizacija trženja
    • Ankete
    Storitve
    • Projekt
    • Časovnice
    • Storitve na terenu
    • Služba za pomoč
    • Načrtovanje
    • Termini
    Produktivnost
    • Razprave
    • Odobritve
    • IoT
    • Voip
    • Znanje
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industrije
    Trgovina na drobno
    • Book Store
    • Trgovina z oblačili
    • Trgovina s pohištvom
    • Grocery Store
    • Trgovina s strojno opremo računalnikov
    • Trgovina z igračami
    Food & Hospitality
    • Bar and Pub
    • Restavracija
    • Hitra hrana
    • Guest House
    • Beverage Distributor
    • Hotel
    Nepremičnine
    • Real Estate Agency
    • Arhitekturno podjetje
    • Gradbeništvo
    • Estate Management
    • Vrtnarjenje
    • Združenje lastnikov nepremičnin
    Svetovanje
    • Računovodsko podjetje
    • Odoo Partner
    • Marketinška agencija
    • Law firm
    • Pridobivanje talentov
    • Audit & Certification
    Proizvodnja
    • Tekstil
    • Metal
    • Pohištvo
    • Hrana
    • Brewery
    • Poslovna darila
    Health & Fitness
    • Športni klub
    • Trgovina z očali
    • Fitnes center
    • Wellness Practitioners
    • Lekarna
    • Frizerski salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Sistemi sončne energije
    • Izdelovalec čevljev
    • Čistilne storitve
    • HVAC Services
    Ostali
    • Neprofitna organizacija
    • Agencija za okolje
    • Najem oglasnih panojev
    • Fotografija
    • Najem koles
    • Prodajalec programske opreme
    Browse all Industries
  • Skupnost
    Learn
    • Tutorials
    • Dokumentacija
    • Certifikati
    • Šolanje
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Prenesi
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Dogodki
    • Prevodi
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Sklici kupca
    • Podpora
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Določanje cen
  • Pomoč

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

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

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

Naroči se

Get notified when there's activity on this post

This question has been flagged
paymentregisterpostodoo10
2 Odgovori
11763 Prikazi
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
Opusti
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
Opusti
MUHAMMED ASLAM
Avtor

Thanks amal .Can you explain this?

Avatar
MUHAMMED ASLAM
Avtor 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
Opusti
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
Avtor

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

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

MUHAMMED ASLAM
Avtor

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
Avtor

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
Avtor

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
Avtor

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!

Prijavi
Related Posts Odgovori Prikazi Aktivnost
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
5562
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
  • Dokumentacija
  • Forum
Open Source
  • Prenesi
  • Github
  • Runbot
  • Prevodi
Services
  • Odoo.sh Hosting
  • Podpora
  • Nadgradnja
  • Custom Developments
  • Izobraževanje
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Sredstva blagovne znamke
  • Kontakt
  • Zaposlitve
  • Dogodki
  • Podcast
  • Blog
  • Stranke
  • Pravno • Zasebnost
  • Varnost
الْعَرَبيّة 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