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

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

  • إدارة علاقات العملاء
  • e-Commerce
  • المحاسبة
  • المخزون
  • PoS
  • المشروع
  • MRP
All apps
يجب أن تكون مسجلاً حتى تتفاعل مع المجتمع.
كافة المنشورات الأفراد الشارات
علامات التصنيف (عرض الكل)
odoo accounting v14 pos v15
حول هذا المنتدى
يجب أن تكون مسجلاً حتى تتفاعل مع المجتمع.
كافة المنشورات الأفراد الشارات
علامات التصنيف (عرض الكل)
odoo accounting v14 pos v15
حول هذا المنتدى
المساعدة

Unable to Apply XPath Highlight to the Phone Field input Inside POS Partner Details

اشتراك

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

لقد تم الإبلاغ عن هذا السؤال
posContactForm
2 الردود
149 أدوات العرض
الصورة الرمزية
abdo

I'm trying to highlight two fields inside the POS Partner Details popup: Name and Phone.

  • Highlighting the Name input works correctly using XPath.

  • But the Phone input is generated inside a t-foreach loop, and its t-attf-name attribute is dynamic, so my XPath never reaches this element, like..

<t t-foreach="['Street','City','Zip','Email','Phone','Mobile','Barcode']" t-as="item">...</t>

my xpath :

<t t-inherit="point_of_sale.PartnerDetailsEdit" t-inherit-mode="extension">    
​<xpath expr="//input[@name='name']" position="attributes">
​ ​<attribute name="style">border: 2px solid #1e90ff !important;</attribute> ​ ​</xpath>

​<xpath expr="//input[@name='phone']" position="attributes">
​ ​<attribute name="style">border:2px solid #1e90ff !important;</attribute> ​ ​</xpath>
</t>


Since the input for Phone is created dynamically inside the loop, I can’t select it with a static XPath like:

//input[@t-attf-name="Phone"]

I tested multiple XPath approaches, but none of them can match the Phone input inside the t-foreach. The rendered DOM is correct in the browser, but XPath inheritance in QWeb can’t target the loop items individually.

Goal: I only want to style the Phone input inside the POS Partner Details, without affecting the other fields.

Problem: XPath inheritance cannot target this specific input because it's created from a loop, so it matches all fields or none.

If anyone has a clean workaround (either correct QWeb targeting or a recommended JS-only POS patch), please advise.

0
الصورة الرمزية
إهمال
Codesphere Tech

Hello,
<t t-name="l10n_pe_pos.PartnerDetailsEdit" t-inherit="point_of_sale.PartnerDetailsEdit" t-inherit-mode="extension">
<xpath expr="//div[input[@t-attf-name='{{item}}']]" position="attributes">
</xpath>

Have you tried like this? Taken from odoo base.

الصورة الرمزية
abdo
الكاتب أفضل إجابة

Thank you for the suggestions and support.

I tried all the recommended XML and JS approaches including inheriting the loop, patching the widget, and using DOM observers but unfortunately the Phone field still isn’t being targeted correctly in my POS setup.

I appreciate all the help shared so far, but the issue remains unresolved on my side.

Thanks again to everyone who took the time to reply.

0
الصورة الرمزية
إهمال
الصورة الرمزية
Cybrosys Techno Solutions Pvt.Ltd
أفضل إجابة
Hi,

To style only the Phone field, you must modify the loop itself or use JavaScript. The clean XML approach is to inherit the loop and check when the loop variable equals "Phone", injecting attributes only in that iteration. This allows adding styles without affecting other fields. The more robust approach—often recommended for POS—is using a small JavaScript patch. With JS, you can target the rendered "phone" input directly in the DOM after the widget is mounted and apply your custom styling.

JS

odoo.define('your_module.partner_edit_highlight', function (require) {
    "use strict";

    const { patch } = require("@web/core/utils/patch");
    const PartnerDetailsEdit = require("point_of_sale.PartnerDetailsEdit");

    patch(PartnerDetailsEdit.prototype, "highlight_phone_field", {
        mounted() {
            this._super(...arguments);
            const phoneInput = this.el.querySelector("input[name='phone']");
            if (phoneInput) {
                phoneInput.style.border = "2px solid #1e90ff";
            }
        },
    });
});

XML

<t t-inherit="point_of_sale.PartnerDetailsEdit" t-inherit-mode="extension">

    <!-- Match the foreach loop -->
    <xpath expr="//t[@t-foreach]" position="inside">
        <t t-if="item == 'Phone'">
            <attribute name="style">border: 2px solid #1e90ff !important;</attribute>
        </t>
    </xpath>

</t>

In short: pure XPath cannot affect dynamically generated elements, so the solution is either inherit the loop or patch the widget in JS. Both methods safely highlight only the Phone input without modifying other fields.



Hope it helps

0
الصورة الرمزية
إهمال
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!

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

تسجيل
المنشورات ذات الصلة الردود أدوات العرض النشاط
Kitchen printing printer other than odoo provided list
pos
الصورة الرمزية
الصورة الرمزية
1
نوفمبر 25
70
POS Table Synchronization Issue Between Devices in Odoo v17 CE
pos
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
2
نوفمبر 25
2551
Refund and Discount access to admin user only for Pos selling
pos
الصورة الرمزية
الصورة الرمزية
1
نوفمبر 25
423
Error in POS with gift cards when testing upgrade to 18
pos
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
3
أكتوبر 25
2258
How to Restrict POS Sales When Product Stock is Zero (Odoo Online 19)
pos
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
2
أكتوبر 25
1291
المجتمع
  • دروس
  • التوثيق
  • المنتدى
مصدر مفتوح
  • تحميل
  • جيت هاب "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 ภาษาไทย 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