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
    Supply Chain
    • 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
    • Discuss
    • Kecerdasan Buatan
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • 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
    • Manajemen Properti
    • 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.
    • Referral Program
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Konsultasi
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan
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

Can anyone correct my code-iam coustmizing odoo 19 defualt pos reciept

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
javascriptpos
1 Balas
1329 Tampilan
Avatar
Ashilkrishna

<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">

<t t-name="odoometer_price_extn.Orderline"
t-inherit="point_of_sale.OrderReceiptLine"
t-inherit-mode="extension"
owl="1">

<xpath expr="//li[hasclass('orderline')]"
position="inside">

<!-- Add MRP display inside the order line -->
<div class="price-per-unit"
style="font-size:10px; color:#666; margin-top:2px;">

<span style="text-decoration:line-through;">
<t t-esc="props.line.mrp"/>
</span>

<span style="margin:0 4px;">→</span>

<span style="font-weight:bold;">
<t t-esc="props.line.price"/>
</span>

<span>/unit</span>

</div>

</xpath>

</t>

</templates>
/** @odoo-module **/

import { patch } from "@web/core/utils/patch";
import { Orderline } from "@point_of_sale/app/store/models";

patch(Orderline.prototype, {

getDisplayData() {
const result = super.getDisplayData(...arguments);

// Add MRP to the display data
result.mrp = this.product.mrp || 0;

return result;
},

});
from odoo import api, models

class ProductProduct(models.Model):
_inherit = 'product.product'

@api.depends('name', 'mrp')
def _compute_display_name(self):
for product in self:
mrp = product.mrp or ''
name = product.name or ''
if mrp:
product.display_name = f"[{mrp}] {name}"
else:
product.display_name = name

def _load_pos_data_fields(self, config_id):
fields = super()._load_pos_data_fields(config_id)

fields.append('mrp')

return fields
{
'name': 'Odoo Meter Price Customizations',
'version': '1.0',
'depends': ['base', 'product', 'account', 'stock_account', 'tradelite_common', 'zl_thermal_invoice_print','point_of_sale'],
'data': [
'views/account_move_view.xml',
'views/product_template_view.xml',
'views/product_product_view.xml',
'report/thermal_invoice_template.xml',
],
'assets': {
'point_of_sale._assets_pos': [

'odoometer_price_extn/static/src/xml/pos_receipt.xml',
'odoometer_price_extn/static/src/js/pos_orderline.js',

],
},
'installable': True,
'application': False,
'auto_install': False,
}

i want replace unitprice/unit by my custom mrp field.

Thanks in advance.


0
Avatar
Buang
Codesphere Tech

I've tested in my Odoo 19 DB and after that I pasted the code here.

Codesphere Tech

May be the issue is in your import statement.Replace with below
import { Orderline } from "@point_of_sale/app/components/orderline/orderline";

Ashilkrishna
Penulis

maybe database issue,i will recheck after creting new db,thankyou for your support.

Ashilkrishna
Penulis

thankyou it worked after replacing import statment ,but i need one modification,i want list_price(like mrp:60 @list_price)

Codesphere Tech

It is already displaying list_price but with tax included.

Avatar
Codesphere Tech
Jawaban Terbai

Hello,
XML template not required.
Just update below code as per your needs(like condition and value).

patch(Orderline.prototype, {
get lineScreenValues() {
const res = super.lineScreenValues;
const line = this.line;

if (line?.order_id && this.props?.mode === "receipt" && line.price !== 0) {

const mrp = line.product_id?.mrp || 0;
const uomName = line.product_id?.uom_id?.name || "unit";

res.displayPriceUnit = `mrp: ${mrp} @ ${line.currencyDisplayPriceUnit}/${uomName}`;
}

return res;
},
});


Hope this helps
Thanks

1
Avatar
Buang
Ashilkrishna
Penulis

i tried using your code but it not working(pos console screen shot upadted in post) ,is their any better way to add mrpline after productname in the place of price_unit/unit by replacing it

Ashilkrishna
Penulis

Can you help me to add a savings/congratulations message at the bottom of the receipt like:

Congrats! You saved 70 on this purchase

The savings amount should be calculated as:

(MRP - List Price) × Quantity

Example:

Product 1:
MRP = 150
List Price = 100
Qty = 1
Savings = 50
Product 2:
MRP = 60
List Price = 50
Qty = 2
Savings = 20

Total savings = 70

I tried patching Orderline and now I am trying to extend OrderReceipt, but I am not sure how to properly access all receipt order lines and display the computed total in the QWeb receipt template.

What is the best approach to implement this in Odoo POS receipt?

Thanks in advance.

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
Odoo 19 POS Pay Later – Need Review of Custom Implementation
javascript pos
Avatar
0
Mei 26
937
I am customizing the POS receipt in Odoo 19.
javascript pos
Avatar
0
Mei 26
967
Odoo 19 POS Receipt Customization – Remove Default Unit Price and Show Custom MRP Line
javascript pos
Avatar
1
Mei 26
1028
does odoo 17 allow to add button to Navbar header in point of sale session inside it to get dynamic data
javascript pos
Avatar
Avatar
1
Nov 24
3646
How to add product in POS programmatically Diselesaikan
javascript pos
Avatar
Avatar
Avatar
Avatar
4
Okt 24
7171
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
  • Karir
  • 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 Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo adalah software terintegrasi dengan 70+ aplikasi seperti CRM, Akuntansi, Inventaris, Sales, eCommerce, Marketing, POS; plus fitur lokal Indonesia!

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