Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
9543 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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 />
Ảnh đại diện
Huỷ bỏ
Tác giả

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 3 18
9898
2
thg 9 25
1346
1
thg 8 25
1149
1
thg 7 25
1409
3
thg 7 25
5045