Skip to Content
Menu
This question has been flagged
1 Reply
1670 Views

Hi all,

I'm trying to change text that is in POS receipt (ticket) in the header "Served by Name Lastname"

Tried to find it in the report_payment_receipt_document but it's not there. Also, tried to find it in point_of_sale -> static -> src -> XML with no luck.

Please help - I need to show only first name here. This here is excellent tutorial but there is no info on how to change Served by text https://www.cybrosys.com/blog/how-to-customize-pos-receipt-odoo-13    

Avatar
Discard
Best Answer

Hi,

In odoo v13 ,

static --> src --> XML

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


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


    <t t-extend="OrderReceipt">


        <t t-jquery=".pos-receipt .pos-receipt-contact .cashier" t-operation='replace'>  


         <div>


                <div>--------------------------------</div>


                <div>


                        Served by : <t t-esc="widget.pos.cashier ? widget.pos.cashier.name : widget.pos.user.name"/><br />


<!--                     replace the details you want to display in the receipt-->


<!-- Instead of cashier.name if you have the filed for first name you can put it here -->


<!-- otherwise you can use this code  -->


Served by : <t t-esc="widget.pos.cashier ? widget.pos.cashier.name.split(' ')[0] : widget.pos.user.name.split(' ')[0]"/><br />


                </div>


         </div>      


        </t>


    </t>


</templates>


Regards

Avatar
Discard
Author

Hi, sorry I forgot to mention it's for v15.

I found it inside of file xml/Screens/ReceiptScreen but the code here is Served by and inside t - esc there is receipt.cashier

Can you please help me how can I get name from receipt.cashier? It is not working when I put receipt.cashier.name

Thank you for your help, I appreciate it.

Author

I was able to get the name using .split(' ')[0] on receipt.cashier

Author

Only remaining question is how to inherit it - in my module I put file inside static -> src -> XML folder and this are it's contents https://ibb.co/X7YR6LM

Here is my __manifes__,py and no error shows up when updating app https://ibb.co/g4zn7qs

Related Posts Replies Views Activity
0
Dec 24
46
1
Dec 24
177
0
Nov 24
90
1
Nov 24
153
1
Nov 24
187