Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
9416 Widoki

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

Awatar
Odrzuć
Najlepsza odpowiedź

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 />
Awatar
Odrzuć
Autor

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

Powiązane posty Odpowiedzi Widoki Czynność
2
mar 18
9516
1
sie 25
806
1
lip 25
1062
3
lip 25
3612
3
maj 25
1913