تخطي للذهاب إلى المحتوى
أودو القائمة
  • تسجيل الدخول
  • جرب مجاناً
  • التطبيقات
    المالية
    • المحاسبة
    • فوترة
    • النفقات
    • جدول البيانات (BI)
    • المستندات
    • توقيع إلكتروني
    المبيعات
    • إدارة علاقات العملاء
    • المبيعات
    • نقطة البيع للمتاجر
    • نقطة البيع للمطاعم
    • الاشتراكات
    • تأجير
    المواقع الإلكترونية
    • أداة بناء المواقع الإلكترونية
    • متاجر إلكترونية
    • مدونة
    • المنتدى
    • دردشة مباشرة
    • التعليم الإلكتروني
    سلسلة التوريد
    • المستودعات
    • التصنيع
    • إدارة دورة حياة المنتج
    • المشتريات
    • الصيانة
    • الجودة
    الموارد البشرية
    • موظفون
    • التوظيف
    • إجازة عمل
    • التقييمات
    • الإحالات
    • تطبيق الأسطول
    التسويق
    • التسويق الإجتماعي
    • التسويق عبر البريد الإلكتروني
    • التسويق عبر الرسائل النصية
    • فعاليات
    • أتمتة التسويق
    • الاستطلاعات
    الخدمات
    • المشاريع
    • الجداول الزمنية
    • الخدمة الميدانية
    • مكتب المساعدة
    • التخطيط
    • مواعيد
    اﻹنتاجية
    • مناقشة
    • الذكاء الاصطناعي
    • إنترنت الأشياء "IoT"
    • بروتوكول ربط المحادثات الصوتية عبر الإنترنت
    • المعرفة
    • WhatsApp
    التطبيقات الخارجية ستوديو أودو منصة أودو السحابية
  • قطاعات الأعمال
    البيع بالتجزئة
    • متجر كتب
    • متجر ملابس
    • متجر أثاث
    • متجر بقالة
    • متجر معدات
    • متجر ألعاب
    الطعام والضيافة
    • بار وحانة
    • المطعم
    • مطعم للوجبات السريعة
    • نزل للضيوف
    • موزّع مشروبات
    • فندق
    العقارات
    • وكالة عقارات
    • شركة هندسة معمارية
    • البناء
    • إدارة العقارات
    • العناية بالحدائق
    • اتحاد مُلاّك العقارات
    استشارة
    • مؤسسة محاسبية
    • شريك أودو
    • وكالة تسويقية
    • منشأة قانونية
    • استقطاب المواهب
    • التدقيق والتوثيق
    التصنيع
    • الأقمشة
    • معدني
    • الأثاث
    • الطعام
    • مصنع خمور
    • هدايا الشركات
    الصحة واللياقة البدنية
    • نادي رياضي
    • متجر نظارات
    • مركز لياقة بدنية
    • الممارسون الصحيون
    • صيدلية
    • صالون تصفيف الشعر
    التجارة
    • عامل صيانة
    • الأجهزة والمعدات التقنية ودعمها
    • أنظمة الطاقة الشمسية
    • صانع أحذية
    • خدمات التنظيف
    • خدمات التكييف (HVAC)
    غير ذلك
    • منظمة غير ربحية
    • وكالة بيئية
    • تأجير لوحات إعلانية
    • تصوير
    • تأجير دراجات
    • بائع وسيط للبرمجيات
    تصفح كافة قطاعات الأعمال
  • مجتمع أودو
    تعلم
    • دروس
    • التوثيق
    • شهادات
    • التدريب
    • مدونة
    • بودكاست
    قم بتعزيز التعليم
    • برنامج تعليم
    • Scale UP! لعبة الأعمال
    • قم بزيارة أودو
    احصل على البرنامج
    • تحميل
    • قارنْ الإصدارات
    • إطلاق
    تعاون
    • جيت هاب "Github"
    • المنتدى
    • فعاليات
    • الترجمات
    • كنْ شريكاً
    • خدمات الشركاء
    • سجل مكتب المحاسبة الخاص بك
    • Referral Program
    احصل على الخدمات
    • اعثر على شريك
    • اعثر على محاسب
    • قابل أحد مرشدي الأعمال
    • خدمات التنفيذ
    • مراجع العملاء
    • الدعم
    • الترقيات
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    الحصول على عرض توضيحي
  • الأسعار
  • المساعدة
يجب أن تكون مسجلاً حتى تتفاعل مع المجتمع.
كافة المنشورات الأفراد الشارات
علامات التصنيف (عرض الكل)
odoo accounting v14 pos v15
حول هذا المنتدى
يجب أن تكون مسجلاً حتى تتفاعل مع المجتمع.
كافة المنشورات الأفراد الشارات
علامات التصنيف (عرض الكل)
odoo accounting v14 pos v15
حول هذا المنتدى
المساعدة

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

اشتراك

تسلم الإشعارات عندما يكون هناك نشاط في هذا المنشور

لقد تم الإبلاغ عن هذا السؤال
posfrontend
3 الردود
2323 أدوات العرض
الصورة الرمزية
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
الصورة الرمزية
إهمال
الصورة الرمزية
CandidRoot Solutions
أفضل إجابة

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
الصورة الرمزية
إهمال
الصورة الرمزية
Kunjan Patel
أفضل إجابة
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
الصورة الرمزية
إهمال
الصورة الرمزية
Bay Forward LLC
أفضل إجابة
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
الصورة الرمزية
إهمال
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!

أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!

تسجيل
المنشورات ذات الصلة الردود أدوات العرض النشاط
Test timeout has no effect تم الحل
test pos frontend
الصورة الرمزية
1
مارس 23
4078
POS Integration: External system not syncing orders — API connection succeeds but no data
pos
الصورة الرمزية
0
مايو 26
5
Product Page Customization in Odoo Online (eCommerce)
frontend
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
2
أبريل 26
1187
Propos and Marvel printers not connecting to Odoo POS
pos
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
2
أبريل 26
2709
18v online Self order: Variants under one product, now they are all separate.
pos
الصورة الرمزية
0
مارس 26
3650
المجتمع
  • دروس
  • التوثيق
  • المنتدى
مصدر مفتوح
  • تحميل
  • جيت هاب "Github"
  • المشغل الآلي رنبوت
  • الترجمات
خدماتنا
  • استضافة أودو إس إتش
  • الدعم
  • الترقية
  • التطويرات المخصصة
  • التعليم
  • اعثر على محاسب
  • اعثر على شريك
  • كنْ شريكاً
معلومات عنا
  • شركتنا
  • أصول العلامة التجارية
  • اتصلْ بنا
  • الوظائف
  • فعاليات
  • بودكاست
  • مدونة
  • عملاء
  • قانوني • الخصوصية
  • الحماية
الْعَرَبيّة 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

أودو هو عبارة عن مجموعة من تطبيقات الأعمال مفتوحة المصدر التي تغطي جميع احتياجات شركتك، مثل: إدارة علاقات العملاء والتجارة الإلكترونية والمحاسبة والمخزون ونقاط البيع وإدارة المشاريع وما إلى ذلك.

ما يجعل من أودو مميزاً هو هدفه بأن يكون سهل الاستخدام للغاية ومتكاملاً تمامًا في الوقت ذاته.

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