Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
7 Răspunsuri
14100 Vizualizări

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" />
                </div>
                <br

 

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?

Thanks

Imagine profil
Abandonează
Autor Cel mai bun răspuns



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" : [
        'static/src/xml/pos.xml',
    ],

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">

....................
            

UPDATE #1

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"?>

            <openerp>

                <data>

                    <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>

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

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

                        </xpath>

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

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

                        </xpath>

                    </template>

                </data>

        </openerp>



Let me know if you need something else.

Imagine profil
Abandonează

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

Autor

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

Autor

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

Nice work Pascal! Thanks!

Cel mai bun răspuns

Hello,

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)' />

 ........
........

</t>

how i can do it by inheritance

thnak you

Imagine profil
Abandonează
Cel mai bun răspuns

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

https://www.odoo.com/forum/help-1/question/print-order-instead-of-coupon-on-pos-what-qweb-view-82635

to understand what I mean.

F.

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
dec. 24
2166
0
aug. 24
1764
1
aug. 24
2793
0
iul. 24
1404
0
mai 23
2291