Skip to Content
Menu
This question has been flagged
2 Replies
2511 Views

Hello all, 

I'm trying to extend the PaymentScreenWidget to show a content block only if the total amount of the order is negative (a return). To do so I have the next t-extend on my code:

<t t-extend='PaymentScreenWidget'>
    <t t-if="widget.pos.get_order().get_total_with_tax() &lt; 0">
        <t t-jquery=".paymentmethods-container" t-operation='append'>
            <div>Blah blah content</div>
        </t>
    </t>
</t>


When I open the POS all I get is a black screen and the next error message on the console:

Uncaught Error: QWeb2: Error while extending template 'PaymentScreenWidgetNo expression given

The same happens if I use conditionals that exist on the original PaymentScreenWidget, for example:

<t t-extend='PaymentScreenWidget'>
    <t t-if="widget.pos.get_client()">
        <t t-jquery=".paymentmethods-container" t-operation='append'>
            <t t-esc="widget.pos.get_client().name" />
        </t>
    </t>
</t>

Any ideas?

Thank you!

Avatar
Discard
Best Answer

Havé you try the t-if inside the t-jquery???

Avatar
Discard

<t t-extend>

<t t-jquery>

<t t-if>

<div>Foo </div>

</t>

</t>

</t>