Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Food & Hospitality
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Guest House
    • Distributor nápojů
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Trades
    • Údržbář
    • IT hardware a podpora
    • Solar Energy Systems
    • Výrobce obuvi
    • Úklidové služby
    • HVAC Services
    Others
    • Nonprofit Organization
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Browse all Industries
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Services for Partners
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

How can remove decimal number ".00" in print receipt?

Odebírat

Get notified when there's activity on this post

This question has been flagged
odoo11community
9 Odpovědi
14003 Zobrazení
Avatar
LaoThai

in PosTicket xml, the price, subtotal, change or something related to price always have .00 at the end. How can we remove them? I can remove outside ( at the price of product ) but, the receipt don't change. Any ideas for this problem. Thanks in advance

1
Avatar
Zrušit
Usman Farzand

use round function

LaoThai
Autor

I used, but it's not working. Beside that, i use python code inside t-esc but it print me "NaN".

Hilar Andikkadavath

convert values to INT

LaoThai
Autor

my value in product is Int ( i revert successfully when create new product with price ). But when you go into POS and print receipt, It's still have .00 on the bill.

Hilar Andikkadavath

inherit pos receipt template and change the value.

Avatar
Cybrosys Techno Solutions Pvt.Ltd
Nejlepší odpověď

Try This :-

<span t-esc="'%.0f'% field_name"/>


7
Avatar
Zrušit
Avatar
Rakesh Vadeghar
Nejlepší odpověď

Hello Try this

10.1223 should  be your_field_name

<t t-esc=" '%.0f' % 10.1223"/> prints 10
<t t-esc=" '%.1f' % 10.1223"/> prints 10.1
<t t-esc=" '%.2f' % 10.1223"/> prints 10.12
1
Avatar
Zrušit
Avatar
Jignesh Mehta
Nejlepší odpověď

Hello LaoThai,


Try This :-

<span t-esc="'%.2f'% field_name"/>


Hope it will works for you.

Thanks,

1
Avatar
Zrušit
LaoThai
Autor

Hello Jignesh, I wite a custom addons to do that, so i need to call the function get_display_price in models.js ( inside point_of_sale ). and then, use that function to show the data without decimal in that field. But when i call this function in my customJs file, it cann't call and give me an error: Unexpected token .

Avatar
Rishan Malaka
Nejlepší odpověď

You can change this from odoo core,

for that go to the point_of_sale module and follow below path to fin the pos.xml file.

point_of_sale -> static -> src -> xml -> pos.xml

under above file change the Total field value  <t t-esc = "widget.format_currency (order.get_total_with_tax ())" />  to
<t t-esc = "order.get_total_with_tax ()" />

<tt-name = "PosTicket"> 
<div class = "pos-sale-ticket">

<div class = "pos-center-align"> <tt-esc = "order.formatted_validation_date" /> <t t -esc = "order.name" /> </ div>
<br />
<t t-esc = "widget.pos.company.name" /> <br />
<div class = "receipt-phone">
Phone : <t t-esc = "widget.pos.company.phone || ''" /> <br />
</ div>
<div class = "receipt-user">
User: <t t-esc = "widget .pos.get_cashier (). name "/> <br />
</ div>
<br />
<tt-if = "receipt.header">
<div style = 'text-align: center'>
<t t-esc = "receipt.header" />
</ div>
<br />
</ t>
<table class = 'receipt-orderlines'>
<colgroup>
<col width = '50%' />
<col width = '25% '/>
<col width =' 25% '/>
</ colgroup>
<tr t-foreach = "orderlines" t-as = "orderline">
<td>
<t t-esc = "orderline.get_product (). Display_name" />
<t t- if = "orderline.get_discount ()> 0">
<div class = "pos-disc-font ">
With a <t t-esc =" orderline.get_discount () "/>% discount
</ div>
</ t>
</ td>
<td class = "pos-right-align">
<t t-esc = "orderline.get_quantity_str_with_unit ()" />
</ td>
<td class = "pos right-align ">
<t t-esc =" widget.format_currency (orderline.get_display_price ()) "/>
</ td>
</ tr>
</ table>
<br />
<table class = 'receipt-total' >
<tr>
<td> Subtotal: </ td>
<td class = "pos-right-align">
<t t-esc = "widget.format_currency (order.get_total_without_tax ())" />
</ td>
</ tr>
<t t-foreach = "order.get_tax_details ()" t-as = "taxdetail">
< tr>
<td> <tt-esc = "taxdetail.name" /> </ td>
<td class = "pos-right-align">
<tt-esc = "widget.format_currency (taxdetail.amount)" />
</ td>
</ tr>
</ t>
<tr>
<t t-if = "order.get_total_discount ()> 0 ">
<td> Discount: </ td>
<td class = "pos-right-align">
<t t-esc = "widget.format_currency (order.get_total_discount ())" />
</ td>
</ t>
</ tr>
<tr class = "emph ">
<td> Total: </ td>
<td class =" pos-right-align ">
<! - <t t-esc =" widget.format_currency (order.get_total_with_tax ()) "/> ->
<t t-esc = "order.get_total_with_tax ()" />
</ td>
</ tr>
</ table>
<br />
<table class = 'receipt-paymentlines'>
<t t-foreach = "paymentlines" t-as = "line">
<tr>
<td>
<t t-esc = "line.name" />
</ td>
<td class = "pos-right-align ">
<tt-esc =" widget.format_currency (line.get_amount ()) "/>
</ td>
</ tr>
</ t>
</ table>
<br />
<table class = 'receipt-change '>
<tr> <td> Change: </ td> <td class = "pos-right-align">
<t t-esc = "widget.format_currency (order.get_change ())" />
</ td> </ tr>
</ table>
<tt-if = "receipt.footer">
<br />
<div style = 'text-align: center'>
<t t-esc = "receipt.footer" />
</ div>
< / t>
</ div>
</ t>


then you can find the change on layout. using that logic you can do your works.
0
Avatar
Zrušit
LaoThai
Autor

I know, but I don't want to change the core code, i want to write my custom addons to update this. In JS file, I can't call the function of models.js at point of sale to use this function and make it clear. Any ideas?

Enjoying the discussion? Don't just read, join in!

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

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
Export time wrong with data in field on odoo 11
odoo11community
Avatar
Avatar
Avatar
2
led 22
4609
How to add “add an item” behavior of odoo one2many fields to main model tree? Vyřešeno
odoo11community
Avatar
Avatar
Avatar
2
pro 21
8767
synchronisation account move and move_line
odoo11community
Avatar
0
čvn 21
2598
How to display a python list in a view ?
odoo11community
Avatar
0
úno 21
3215
Create a table in a view
odoo11community
Avatar
0
úno 21
4937
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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