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

Hello! I need help to customize printing tickets

. I want to print two differents numbers.

The first is a correlative number (pos_reference)

The second is the id order ("id" in the table pos_order)

The first I already customized it, but the second I don't know how to call that column from the db.

Help please! (Sorry for my english)

Image example: http://i.imgur.com/ORIKhg1.png

Avatar
Discard
Best Answer

In pos.order table "id" is the unique identifier for orders. I think you can simply fetch the same from that table. Please try with below:

1- Go to addons/point_of_sale/static/src/js/models.js

2-Append below code there:

    { model: 'pos.order', fields: ['name'],

    loaded: function(self,orders){ self.order = orders[0]; }, },

3- Inside that template, Find the line - "Shop: <t t-esc="widget.pos.shop.name"/><br />"

4- just add the below the following line:

     Ticket :<t t-esc="widget.pos.order.id+1"/><br />


----OR----

1- Go to addons/point_of_sale/static/src/xml/pos.xml

2- Find: <t t-name="PosTicket">

3- Inside that template, Find the line -  "Shop: <t t-esc="widget.pos.shop.name"/><br />"

4- just add the below the following line:

Ticket :<t t-esc="widget.pos.pos_session.sequence_number++"/><br />
Avatar
Discard
Author

Can you help me to do it? I'm a beginner, Do you know where is the file that call this model "pos_order" to fetch the "id" to the ticket?

Please find the correct way in answer, I just edited with what you want.

Hope this may help you. :)

Is there any way to add pos_reference field in table pos_order to POS ticket printout? Any help is appreciated

Related Posts Replies Views Activity
2
Mar 18
9406
1
Aug 25
678
1
Jul 25
933
3
Jul 25
3170
3
May 25
1694