Odoo Help


How to inherit posticket template?

Pascal Tremblay
on 2/16/15, 2:29 PM 5,306 views

Still me...

I know that the receipt in the POS is defined in the file /home/odoo/addons/point_of_sale/static/src/xml/pos.xml :

<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">



    <t t-name="PosTicket">
        <div class="pos-sale-ticket">
            <div class="pos-center-align"><t t-esc="new Date().toString(Date.CultureInfo.formatPatterns.shortDate + ' ' +
                Date.CultureInfo.formatPatterns.longTime)"/> <t t-esc="order.get('name')"/></div>
            <br />
            <t t-esc="widget.pos.company.name"/><br />
            PhoneSSSSSSSSS: <t t-esc="widget.pos.company.phone || ''"/><br />
            User: <t t-esc="widget.pos.cashier ? widget.pos.cashier.name : widget.pos.user.name"/><br />
            Shop: <t t-esc="widget.pos.shop.name"/><br />
            <br />
            <t t-if="widget.pos.config.receipt_header">
                <div style='text-align:center'>
                    <t t-esc="widget.pos.config.receipt_header" />


But it is the first time I see the templates (with the s at the end) xml tag.

How can I override or inherit only PosTicket from this last file in my own module?



Pascal Tremblay

--Pascal Tremblay--
| 5 3 7
Alma, Canada
--Pascal Tremblay--

Pascal Tremblay
On 2/17/15, 6:05 AM

I'm now able to override the original point of sale ticket/receipt.

In my custom file /Volumes/odoo/addons/report_lapagept/__openerp__.py
    'depends' : ['point_of_sale'],
    "qweb" : [

In my custom file /Volumes/odoo/addons/report_lapagept/static/src/xml/pos.xml, I had just declare PosTicket again and it override the original.

<?xml version="1.0" encoding="UTF-8"?>

<templates id="template" xml:space="preserve">

    <t t-name="PosTicket">
        <div class="pos-sale-ticket">



Now to override model.js, we have this in the file /home/odoo-test/odoo-test/addons_pt/pos_lapagept/lapagept_templates.xml  :

        <?xml version="1.0" encoding="utf-8"?>



                    <template id="assets_backend" name="point_of_sale assets" inherit_id="point_of_sale.assets_backend">

                        <xpath expr="//script[contains(@src,'widget_base.js')]" position="replace">

                            <script type="text/javascript" src="/pos_lapagept/static/src/js/widget_base_pt.js"></script>


                        <xpath expr="." position="inside">

                            <script type="text/javascript" src="/pos_lapagept/static/src/js/widgets_as.js"></script>


                        <xpath expr="//script[contains(@src,'models.js')]" position="replace">

                               <script type="text/javascript" src="/pos_lapagept/static/src/js/models_pt.js"></script>





Let me know if you need something else.

Hello Pascal , have you gone about inheriting / overriding the point of sale js files (models.js ) as i want to inherit this file?

Erhuvwu Akpobaro
on 4/22/15, 10:27 AM

Please wait until tomorrow. I could may be help you.

Pascal Tremblay
on 4/22/15, 10:31 AM

I'm updating my answer with what we have here.

Pascal Tremblay
on 4/22/15, 12:53 PM

Nice work Pascal! Thanks!

on 4/22/15, 2:27 PM
On 9/10/15, 2:23 AM


I just need to add some field to the   ClientDetails div

<t t-name="ClientDetails">

<section class='client-details'>

<div class='client-picture'>

<img t-att-src='widget.partner_icon_url(partner.id)' />



how i can do it by inheritance

thnak you

On 4/22/15, 4:17 PM

Pascal, did you tried to link directly an Odoo qweb report instead of edit/inherit the stock one? Would be interesting for those who don't have a proxy printer but just a system printer. Have a look here


to understand what I mean.


About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 2/16/15, 2:29 PM
Seen: 5306 times
Last updated: 9/10/15, 2:23 AM