Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
1328 มุมมอง

Dear community,


The problem I have is that in my test environment the replacement of the pos ticket header data works but in TEST of the client it does not work and shows the error: "Parsing asset bundle point_of_sale.assets_prod.min.js has failed: The element '<xpath expr="//div[hasclass(&#39;pos-receipt-contact&#39;)]//div">' cannot be located in the view father"



The added code is:


<t t-name="pw_pos_change_logo.ReceiptHeader_text" t-inherit="point_of_sale.ReceiptHeader" t-inherit-mode="extension">

        <xpath expr="//div[hasclass('pos-receipt-contact')]" position="replace">

            <div t-if="props.data.header" style="white-space:pre-line" t-esc="props.data.header" />

            <div t-if="props.data.cashier" class="cashier">

                <div>--------------------------------</div>

                <div>Served by <t t-esc="props.data.cashier" /></div>

            </div>

            <div class="fw-bolder" t-if="props.data.trackingNumber and !props.data.bigTrackingNumber">

                <span class="fs-2" t-esc="props.data.trackingNumber" />

            </div>

        </xpath>

    </t>



Kind regards

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

I see that the problem you have is because other modules depend on that hasclass to add a complement, therefore you cannot replace it completely, try to replate the lines of code that you want to modify but not everything completely.

Try:

<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="ReceiptHeader" t-inherit="point_of_sale.ReceiptHeader" t-inherit-mode="extension">

​# FOR EXAMPLE
​<xpath expr="//div[hasclass('cashier')]/div[2]" position="replace">
​<div>Cashier: <t t-esc="props.data.cashier" /></div>
​</xpath>
​​
​</t>
</templates>
อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ส.ค. 24
1284
0
มิ.ย. 24
1176
2
ม.ค. 25
1150
1
ม.ค. 25
1964
POS OrderReceipt - add Lot number แก้ไขแล้ว
3
พ.ย. 24
1225