Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
4395 Visualizzazioni

I need to create module, which alters template for receipt from point_of_sale module. In documentation it is said that in order to do so one needs just:

<t t-extend="base.template">
    <t t-jquery="ul" t-operation="append">
        <li>new element</li>
    </t>
</t>

I created module and added file in static/src/xml folder, where written following:

<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-extend="point_of_sale.XmlReceipt">
<t t-jquery="div.orderlines" t-operation="append">
<h2>Hello world!</h2>
</t>
</t></templates>


But receipt template remains the same. Am I missing something?

Avatar
Abbandona
Risposta migliore

hello,

the Q-web format you used is correct please check these things:

-after t-extend you should give template id of the template without module name(if template id is XmlReciept dont add point_of_sale before it)

-append and prepend is used for appending of the node. I think in you examples you should use after or before to add html tag like <h2>.

-also if you have'nt declared this file in openerp file, this is how you can add it:

     'qweb': [
        'static/src/xml/client_action_sent_mails.xml',

    ],


Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
gen 17
5414
0
giu 23
1801
0
lug 21
2016
2
lug 17
4486
1
ott 15
4780