Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
3263 Переглядів

I want to replace the env.pos.format_currency_no_symbol(line.price_display_one) line inside the OrderReceipt.xml (see image below)


In my custom module, the xpath expr is:


But the intended change did not took effect.

Аватар
Відмінити

Did you include the xml file in the manifest?

Найкраща відповідь

Hello, JTY

The way you inherit the template is correct.

Please find code in comment.

I hope This will help you.

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Аватар
Відмінити

So, make sure you define it in the manifest as follows (for odoo 15):

'assets': {
'web.assets_qweb': [
'module/static/src/xml/OrderReceipt.xml',
],
},

And also make sure your xml file should be in “/static/src/xml” path. If everything is ok then upgrade the module.

Найкраща відповідь

In pos receipt there is no OrderLineReceipt to inherit.

you can use the div[@class('orderlines') and replace what you want to replace as following

"1.0" encoding="UTF-8"?>    "receipt_template" inherit_id="point_of_sale.template" xml:space="preserve">
"OrderReceipt" t-inherit="point_of_sale.OrderReceipt" t-inherit-mode="extension" owl="1">    "//div[@class('pos-receipt-contact')]" position="inside">        'receipt.client'>       

Clinet:            "receipt.client.name"/>       
           

    "//div[@class('orderlines')]" position="replace">   
"orderlines">        "receipt.orderlines" t-as="line" t-key="line.id">            "isSimple(line)">               
                    "line.product_name_wrapped[0]" />                    "env.pos.format_currency_no_symbol(line.price_display)" class="price_display pos-receipt-right-align"/>               
                "line" />           
            "">               
"line.product_name_wrapped[0]" />                "line" />                "line.display_discount_policy == 'without_discount' and line.price != line.price_lst">                   
"pos-receipt-left-padding">                        "env.pos.format_currency_no_symbol(line.price_lst)" />                        ->                        "env.pos.format_currency_no_symbol(line.price)" />                   
               
                "line.discount !== 0">                   
"pos-receipt-left-padding">                        "env.pos.config.iface_tax_included === 'total'">                            "env.pos.format_currency_no_symbol(line.price_with_tax_before_discount)"/>                                                "">                            "env.pos.format_currency_no_symbol(line.price)"/>                                           
               
                "line.discount !== 0">                   
"pos-receipt-left-padding">                        Discount: "line.discount" />%                   
               
               
"pos-receipt-left-padding">                    "Math.round(line.quantity * Math.pow(10, env.pos.dp['Product Unit of Measure'])) / Math.pow(10, env.pos.dp['Product Unit of Measure'])"/>                    "line.unit_name !== 'Units'" t-esc="line.unit_name" />                    x                    "env.pos.format_currency_no_symbol(line.price_display_one)" />                    "price_display pos-receipt-right-align">                        "env.pos.format_currency_no_symbol(line.price_display)" />



Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
трав. 25
2326
1
трав. 24
1745
1
квіт. 24
1422
3
квіт. 23
6409
3
трав. 22
1906