Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
9519 Представления

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

Аватар
Отменить
Лучший ответ

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 />
Аватар
Отменить
Автор

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 Ответы Просмотры Активность
2
мар. 18
9867
2
сент. 25
1315
1
авг. 25
1131
1
июл. 25
1396
3
июл. 25
4936