Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
9355 Vistas

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
Descartar
Mejor respuesta

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

Publicaciones relacionadas Respuestas Vistas Actividad
2
mar 18
9391
1
ago 25
666
1
jul 25
922
3
jul 25
3107
3
may 25
1664