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.
    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

I am customizing the POS receipt in Odoo 19.

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
javascriptpos
943 Tampilan
Avatar
Ashilkrishna

I am customizing the POS receipt in Odoo 19.

I want 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.

my code-

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
/** @odoo-module **/

import { patch } from "@web/core/utils/patch";
import { OrderReceipt } from "@point_of_sale/app/screens/receipt_screen/receipt/order_receipt";

patch(OrderReceipt.prototype, {

get totalSavedAmount() {
const order = this.props.data;
let totalSaved = 0;

order.orderlines.forEach(line => {

const mrp = line.product_id?.mrp || 0;
const listPrice = line.product_id?.lst_price || 0;
const qty = line.qty || 1;

const diff = (mrp - listPrice) * qty;

totalSaved += diff;
});

return totalSaved;
},

});
/** @odoo-module **/

import { patch } from "@web/core/utils/patch";
import { Orderline } from "@point_of_sale/app/components/orderline/orderline";

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 listPrice = line.product_id?.lst_price || 0;
const uomName = line.product_id?.uom_id?.name || "unit";

res.displayPriceUnit = `MRP: ${mrp} @ ${listPrice}/${uomName}`;
}

return res;
},
});
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<t t-name="odoometer_price_extn.OrderReceipt"
t-inherit="point_of_sale.OrderReceipt"
t-inherit-mode="extension">

<xpath expr="//div[contains(@class,'pos-receipt-order-data')]" position="after">

<t t-if="totalSavedAmount > 0">
<div style="text-align:center; margin-top:10px; font-weight:bold;">
Congrats! You saved
<t t-esc="totalSavedAmount"/>
on this purchase
</div>
</t>

</xpath>

</t>
</odoo>
0
Avatar
Buang
Codesphere Tech

Hello,
I'll let you know.

Codesphere Tech

The code sent to your email. Please check.

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
913
Can anyone correct my code-iam coustmizing odoo 19 defualt pos reciept Diselesaikan
javascript pos
Avatar
Avatar
1
Mei 26
1315
Odoo 19 POS Receipt Customization – Remove Default Unit Price and Show Custom MRP Line
javascript pos
Avatar
1
Mei 26
1018
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
3641
How to add product in POS programmatically Diselesaikan
javascript pos
Avatar
Avatar
Avatar
Avatar
4
Okt 24
7168
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