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

How to include a custom pos.order field in OrderReceipt frontend template (Odoo 18)

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
posfrontend
3 Replies
2288 Tampilan
Avatar
Ariko Stephen Philemon

Hi all,

I’m trying to expose a custom field added on pos.order so that it can be used in the POS frontend OrderReceipt QWeb/OWL template in Odoo 18.

Goal

I want a custom field defined on pos.order to be available in the POS frontend, specifically in the order_receipt template.

What I have done

I extended the pos.order model and tried to load the field using _load_pos_data_fields method , as shown below:

pos_order.py
from odoo import models, fields, api
# pos_order.py
from odoo import models, fields, api

class PosOrder(models.Model):
_inherit = "pos.order"

custom_field = fields.Char()

@api.model
def _load_pos_data_fields(self, config_id):
fields = super()._load_pos_data_fields(config_id)
fields.append("custom_field")
return fields
Frontend error

After this change, the POS UI doesn't load at all, it crashes with the following error:

installHook.js:1 TypeError: Cannot read properties of undefined (reading 'filter') at get taxTotals (point_of_sale.assets_prod.min.js:8929:1016)
What I found so far

I found a couple of older forum posts and answers that suggest extending _loader_params_pos_order method on pos.session model

However, in Odoo 18, _loader_params_pos_order no longer exists, so those solutions are no longer applicable.


What is the correct way in Odoo 18 to load additional pos.order fields into the POS frontend?

0
Avatar
Buang
Avatar
CandidRoot Solutions
Jawaban Terbai

Hello Ariko,

In Odoo 18, your approach using _load_pos_data_fields() is not correct for POS orders, and that is why the POS frontend crashes.

Why _load_pos_data_fields() does NOT work
  • In Odoo 18, POS orders are created and handled in the frontend (JS)

  • pos.order records are NOT loaded from backend when POS starts

  • _load_pos_data_fields() is meant for models fetched during POS loading, not for runtime orders

Because of this:

  • POS expects a specific data structure

  • Adding extra fields via _load_pos_data_fields() breaks the JS model

  • Result: POS crashes (taxTotals → undefined.filter error)

So this error is expected behavior, not a bug.

Correct way in Odoo 18 (Recommended)

To show a custom field on the POS receipt, you must extend the frontend export logic, not backend loading.

Patch export_for_printing() in JS

// static/src/app/models/pos_order.js import { PosOrder } from "@point_of_sale/app/models/pos_order"; import { patch } from "@web/core/utils/patch"; patch(PosOrder.prototype, { export_for_printing(baseUrl, headerData) { const result = super.export_for_printing(baseUrl, headerData); result.custom_field = this.custom_field || ""; return result; }, });

Display it in the receipt template

<t t-name="your_module.OrderReceipt" t-inherit="point_of_sale.OrderReceipt" t-inherit-mode="extension"> <xpath expr="//div[hasclass('pos-receipt-order-data')]" position="after"> <div t-esc="props.data.custom_field"/> </xpath> </t>

Why this works
  • export_for_printing() is the single source of truth for receipt data

  • Receipt templates only consume what this method returns

  • This is the official and stable approach in Odoo 18

    If this clarification helped you, kindly upvote.

    Best Regards

    CandidRoot Solutions Pvt. Ltd.
  • Mobile: (+91) 8849036209
  • Whatapp: (+91) 8849036209
  • Email: info@candidroot.com
  • Web: https://www.candidroot.com

1
Avatar
Buang
Avatar
Kunjan Patel
Jawaban Terbai
Hello Ariko Stephen Philemon,
I hope you are doing well

Odoo 18: Custom Field in POS Receipt
Patch export_for_printing() in JS
  // static/src/app/models/pos_order.js
  import { PosOrder } from "@point_of_sale/app/models/pos_order";
  import { patch } from "@web/core/utils/patch";

  patch(PosOrder.prototype, {
      export_for_printing(baseUrl, headerData) {
          const result = super.export_for_printing(baseUrl, headerData);
          result.custom_field = this.custom_field || "";
          return result;
      },
  });

 Display in template
  <t t-name="module.OrderReceipt" t-inherit="point_of_sale.OrderReceipt" t-inherit-mode="extension">
      <xpath expr="//div[hasclass('pos-receipt-order-data')]" position="after">
          <div t-esc="props.data.custom_field"/>
      </xpath>
  </t>  

Why _load_pos_data_fields doesn't work: Orders are created in frontend JS, not loaded from backend. The receipt uses export_for_printing() to build its data.

I hope this information helps you

Thanks & Regards
Kunjan Patel
1
Avatar
Buang
Avatar
Bay Forward LLC
Jawaban Terbai
Extend the OrderReceipt widget in your custom module and add your field in the render method. Example:\
\
```javascript\
OrderReceipt.include({\
    render: function() {\
        this._super.apply(this, arguments);\
        this.$el.find('.receipt-container').append('<div>' + this.pos.get_order().your_custom_field + '</div>');\
    }\
});\

```

0
Avatar
Buang
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
Test timeout has no effect Diselesaikan
test pos frontend
Avatar
1
Mar 23
4072
POS Integration: External system not syncing orders — API connection succeeds but no data
pos
Avatar
0
Mei 26
5
Product Page Customization in Odoo Online (eCommerce)
frontend
Avatar
Avatar
Avatar
2
Apr 26
1180
Propos and Marvel printers not connecting to Odoo POS
pos
Avatar
Avatar
Avatar
2
Apr 26
2682
18v online Self order: Variants under one product, now they are all separate.
pos
Avatar
0
Mar 26
3625
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