From 63d1eef8268f35600462b8a724c16e7b4a7ebb29 Mon Sep 17 00:00:00 2001
From: Juliana <juliana@le-filament.com>
Date: Mon, 22 Nov 2021 17:35:14 +0100
Subject: [PATCH] Print Barcode ticket

---
 __manifest__.py          |  2 +-
 static/src/js/screens.js |  3 +++
 static/src/xml/pos.xml   | 11 ++++-------
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/__manifest__.py b/__manifest__.py
index 4d0e3c1..f2df358 100755
--- a/__manifest__.py
+++ b/__manifest__.py
@@ -1,7 +1,7 @@
 {
     "name": "VRACOOP - POS Balance ticketing",
     "summary": "POS Balance ticketing",
-    "version": "12.0.0.2",
+    "version": "12.0.1.0",
     "development_status": "Beta",
     "author": "Le Filament",
     "maintainers": ["remi-filament"],
diff --git a/static/src/js/screens.js b/static/src/js/screens.js
index 48cc59a..675c518 100644
--- a/static/src/js/screens.js
+++ b/static/src/js/screens.js
@@ -71,6 +71,8 @@ odoo.define('vracoop_balance_ticketing.screens', function (require) {
             var num_ean13 = this.pos.config.prefix + transaction.ean13.slice(2)
             var width_pix = (Math.round(this.pos.config.page_width * 3.78)).toString() + "px";
 
+            var url_barcode = "/report/barcode/?type=EAN13&value=" + num_ean13 + "&width=600&height=150"
+
             return {
                 widget: this,
                 pos: this.pos,
@@ -78,6 +80,7 @@ odoo.define('vracoop_balance_ticketing.screens', function (require) {
                 transaction: transaction,
                 num_ean13: num_ean13,
                 width: width_pix,
+                url_barcode: url_barcode,
             };
         },
         print_web: function() {
diff --git a/static/src/xml/pos.xml b/static/src/xml/pos.xml
index 569bb1d..7242f0a 100644
--- a/static/src/xml/pos.xml
+++ b/static/src/xml/pos.xml
@@ -64,6 +64,7 @@
                 <tr class="title-info bloc-barcode">
                     <td>
                         <img t-att-src="widget.get_barcode_url()" style="width:100%;height:35%;" />
+                        <span class="caption"><t t-esc="num_ean13"/></span>
                     </td>
                 </tr>
             </table>
@@ -109,15 +110,11 @@
                     <br />
                     <br />
                     <line>
-                        <left>
-                            <img t-att-src="widget.get_barcode_url()" style="width:100%;height:35%;" />
-                            <span class="caption"><t t-esc="num_ean13"/></span>
-                        </left>
-                    </line>
-                    <line>
-                        <img t-att-src="widget.get_barcode_url()" style="width:100%;height:35%;" />
+                        <img t-att-src="url_barcode" style="width:100%;height:35%;" />
                         <span class="caption"><t t-esc="num_ean13"/></span>
                     </line>
+                    <br />
+                    <br />
                 </div>
             </div>
         </receipt>
-- 
GitLab