تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
2783 أدوات العرض

I have a problem when trying to replace div that is related to other div will inherits 

my code as following :

xml version="1.0" encoding="UTF-8"?><templatesid="pos_custom"xml:space="preserve">
<tt-inherit="point_of_sale.OrderReceipt"t-inherit-mode="extension"owl="1">
    <xpathexpr="//div[hasclass('pos-receipt-contact')]"position="replace">               <p>Success !p>    xpath>   t>templates>

my log error : 
ValueError: Element '' cannot be located in parent view - - -2022-07-2808:05:21,977351769INFO ? werkzeug: 192.168.0.61 - - [28/Jul/202208:05:21] "GET /web/static/lib/stacktracejs/stacktrace.js HTTP/1.1"200 - - - -2022-07-2808:05:21,993351769INFO newestDB07021 werkzeug: 192.168.0.61 - - [28/Jul/202208:05:21] "GET /web/webclient/locale/en_US HTTP/1.1"200 - 10.0010.0042022-07-2808:05:22,057351769INFO newestDB07021 werkzeug: 192.168.0.61 - - [28/Jul/202208:05:22] "GET /web/assets/debug/web.assets_backend_prod_only.js HTTP/1.1"200 - 30.0030.0582022-07-2808:05:22,057351769INFO newestDB07021 werkzeug: 192.168.0.61 - - [28/Jul/202208:05:22] "GET /web/assets/debug/web.assets_backend.js HTTP/1.1"200 - 30.0020.061

الصورة الرمزية
إهمال
أفضل إجابة

Hi,

Try this:

<?xml version="1.0" encoding="utf-8"?>
<templates id="template" xml:space="preserve">
<t t-name="pos_custom" t-inherit="point_of_sale.ReceiptHeader" t-inherit-mode="extension">
<xpath expr="//div[hasclass('pos-receipt-contact')]" position="replace">

                   <p>Success !p>

</xpath>


Hope it helps

الصورة الرمزية
إهمال

It work ok, thanks Cybrosys

المنشورات ذات الصلة الردود أدوات العرض النشاط
0
يناير 23
9
1
نوفمبر 22
2908
2
يوليو 22
2505
1
يونيو 22
2031
1
أبريل 22
3714