odoo-driver 0.9.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. odoo_driver-0.9.6/PKG-INFO +306 -0
  2. odoo_driver-0.9.6/README.md +264 -0
  3. odoo_driver-0.9.6/odoo_driver/__init__.py +5 -0
  4. odoo_driver-0.9.6/odoo_driver/app.py +29 -0
  5. odoo_driver-0.9.6/odoo_driver/cli.py +121 -0
  6. odoo_driver-0.9.6/odoo_driver/default_cert/server.crt +22 -0
  7. odoo_driver-0.9.6/odoo_driver/default_cert/server.key +28 -0
  8. odoo_driver-0.9.6/odoo_driver/devices/__init__.py +4 -0
  9. odoo_driver-0.9.6/odoo_driver/devices/device_display.py +147 -0
  10. odoo_driver-0.9.6/odoo_driver/devices/device_payment.py +20 -0
  11. odoo_driver-0.9.6/odoo_driver/devices/device_printer.py +25 -0
  12. odoo_driver-0.9.6/odoo_driver/devices/device_scale.py +34 -0
  13. odoo_driver-0.9.6/odoo_driver/devices/models/__init__.py +0 -0
  14. odoo_driver-0.9.6/odoo_driver/devices/models/device_abstract.py +115 -0
  15. odoo_driver-0.9.6/odoo_driver/devices/models/device_abstract_with_queue.py +84 -0
  16. odoo_driver-0.9.6/odoo_driver/devices/models/device_task.py +10 -0
  17. odoo_driver-0.9.6/odoo_driver/devices/scale_dialog06/__init__.py +0 -0
  18. odoo_driver-0.9.6/odoo_driver/devices/scale_dialog06/scale_answer.py +101 -0
  19. odoo_driver-0.9.6/odoo_driver/devices/scale_dialog06/scale_command.py +169 -0
  20. odoo_driver-0.9.6/odoo_driver/devices/scale_dialog06/state_machine.py +93 -0
  21. odoo_driver-0.9.6/odoo_driver/devices/tools/__init__.py +0 -0
  22. odoo_driver-0.9.6/odoo_driver/devices/tools/serial_code.py +12 -0
  23. odoo_driver-0.9.6/odoo_driver/flask_app/__init__.py +8 -0
  24. odoo_driver-0.9.6/odoo_driver/flask_app/flask_app_display.py +20 -0
  25. odoo_driver-0.9.6/odoo_driver/flask_app/flask_app_odoo.py +67 -0
  26. odoo_driver-0.9.6/odoo_driver/flask_app/flask_app_payment.py +23 -0
  27. odoo_driver-0.9.6/odoo_driver/flask_app/flask_app_printer.py +30 -0
  28. odoo_driver-0.9.6/odoo_driver/flask_app/flask_app_scale.py +26 -0
  29. odoo_driver-0.9.6/odoo_driver/flask_app/flask_app_website.py +115 -0
  30. odoo_driver-0.9.6/odoo_driver/interface.py +162 -0
  31. odoo_driver-0.9.6/odoo_driver/static/audio/photo-taken.wav +0 -0
  32. odoo_driver-0.9.6/odoo_driver/static/css/bootstrap.min.css +6 -0
  33. odoo_driver-0.9.6/odoo_driver/static/css/bootstrap.min.css.map +1 -0
  34. odoo_driver-0.9.6/odoo_driver/static/css/odoo_pos_driver.css +3 -0
  35. odoo_driver-0.9.6/odoo_driver/static/devices/display.png +0 -0
  36. odoo_driver-0.9.6/odoo_driver/static/devices/display__aures__ocd_300.png +0 -0
  37. odoo_driver-0.9.6/odoo_driver/static/devices/payment.png +0 -0
  38. odoo_driver-0.9.6/odoo_driver/static/devices/payment__ingenico__move_5000.png +0 -0
  39. odoo_driver-0.9.6/odoo_driver/static/devices/printer.png +0 -0
  40. odoo_driver-0.9.6/odoo_driver/static/devices/printer__epson__tm_t20.png +0 -0
  41. odoo_driver-0.9.6/odoo_driver/static/devices/scale.png +0 -0
  42. odoo_driver-0.9.6/odoo_driver/static/devices/scale__mettler_toledo__ariva_s.png +0 -0
  43. odoo_driver-0.9.6/odoo_driver/static/img/favicon.png +0 -0
  44. odoo_driver-0.9.6/odoo_driver/static/img/odoo.png +0 -0
  45. odoo_driver-0.9.6/odoo_driver/static/js/bootstrap.min.js +7 -0
  46. odoo_driver-0.9.6/odoo_driver/static/js/bootstrap.min.js.map +1 -0
  47. odoo_driver-0.9.6/odoo_driver/static/js/jquery.min.js +2 -0
  48. odoo_driver-0.9.6/odoo_driver/static/js/webcam-easy.js +186 -0
  49. odoo_driver-0.9.6/odoo_driver/static/readme/home_page.png +0 -0
  50. odoo_driver-0.9.6/odoo_driver/static/readme/security_exception.png +0 -0
  51. odoo_driver-0.9.6/odoo_driver/templates/application.html.jinja +24 -0
  52. odoo_driver-0.9.6/odoo_driver/templates/disconnections.html.jinja +25 -0
  53. odoo_driver-0.9.6/odoo_driver/templates/errored_tasks.html.jinja +27 -0
  54. odoo_driver-0.9.6/odoo_driver/templates/home.html.jinja +429 -0
  55. odoo_driver-0.9.6/odoo_driver/templates/layout.html.jinja +52 -0
  56. odoo_driver-0.9.6/odoo_driver/templates/photo_booth.html.jinja +67 -0
  57. odoo_driver-0.9.6/odoo_driver/templates/system.html.jinja +24 -0
  58. odoo_driver-0.9.6/odoo_driver/templates/usb_devices.html.jinja +40 -0
  59. odoo_driver-0.9.6/odoo_driver/translations/babel.cfg +2 -0
  60. odoo_driver-0.9.6/odoo_driver/translations/fr/LC_MESSAGES/messages.mo +0 -0
  61. odoo_driver-0.9.6/odoo_driver/translations/fr/LC_MESSAGES/messages.po +299 -0
  62. odoo_driver-0.9.6/odoo_driver/translations/odoo-pos-driver.pot +294 -0
  63. odoo_driver-0.9.6/odoo_driver/usb_device/__init__.py +0 -0
  64. odoo_driver-0.9.6/odoo_driver/usb_device/usb_device_list.py +63 -0
  65. odoo_driver-0.9.6/odoo_driver/usb_device/usb_device_tools.py +41 -0
  66. odoo_driver-0.9.6/pyproject.toml +64 -0
@@ -0,0 +1,306 @@
1
+ Metadata-Version: 2.1
2
+ Name: odoo-driver
3
+ Version: 0.9.6
4
+ Summary: Python library to communicates with devices used by Odoo.(Mainly Point of Sale application)Alternative to Iot Box Odoo solution or Pywebdriver community solution.
5
+ Home-page: https://gitlab.com/grap-rhone-alpes/odoo-driver
6
+ Keywords: Odoo,Point Of Sale,Driver
7
+ Author: Sylvain LE GAL
8
+ Author-email: sylvain.legal@grap.coop
9
+ Maintainer: Sylvain LE GAL
10
+ Maintainer-email: sylvain.legal@grap.coop
11
+ Requires-Python: >=3.9,<4.0.0
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Framework :: Odoo
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: GNU Affero General Public License v3
16
+ Classifier: Operating System :: Unix
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Requires-Dist: click-loglevel (>=0.5.0,<0.6.0)
23
+ Requires-Dist: flask (>=3.0.3,<4.0.0)
24
+ Requires-Dist: flask-babel (>=4.0.0,<5.0.0)
25
+ Requires-Dist: flask-cors (>=4.0.1,<5.0.0)
26
+ Requires-Dist: gevent (>=24.2.1,<25.0.0)
27
+ Requires-Dist: gevent-websocket (>=0.10.1,<0.11.0)
28
+ Requires-Dist: importlib-resources (>=6.4.0,<7.0.0)
29
+ Requires-Dist: loguru (>=0.7.2,<0.8.0)
30
+ Requires-Dist: psutil (>=6.0.0,<7.0.0)
31
+ Requires-Dist: pyserial (>=3.5,<4.0)
32
+ Requires-Dist: pyteliummanager (>=2.4.2,<3.0.0)
33
+ Requires-Dist: python-escpos (>=3.1,<4.0)
34
+ Requires-Dist: python-statemachine (>=2.3.4,<3.0.0)
35
+ Requires-Dist: pyusb (>=1.2.1,<2.0.0)
36
+ Requires-Dist: simplejson (>=3.19.3,<4.0.0)
37
+ Requires-Dist: single-source (>=0.4.0,<0.5.0)
38
+ Requires-Dist: unidecode (>=1.3.8,<2.0.0)
39
+ Project-URL: Repository, https://gitlab.com/grap-rhone-alpes/odoo-driver
40
+ Description-Content-Type: text/markdown
41
+
42
+ ![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)
43
+ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/odoo-driver)
44
+ ![PyPI - Downloads](https://img.shields.io/pypi/dm/odoo-driver)
45
+ ![GitLab last commit](https://img.shields.io/gitlab/last-commit/60778766)
46
+ ![GitLab stars](https://img.shields.io/gitlab/stars/60778766?style=social)
47
+ [![Socket Badge](https://socket.dev/api/badge/pypi/package/odoo-driver)](https://socket.dev/pypi/package/odoo-driver)
48
+
49
+ # Odoo POS Driver
50
+
51
+ This tools is intented to be used with the Odoo Point of sale application. It replaces the Odoo [IoT Box](https://www.odoo.com/app/iot) or the
52
+ Community [pywebdriver](https://github.com/pywebdriver/pywebdriver) library.
53
+
54
+ Once installed locally in the cashier computer, devices will be discovered by the tool,
55
+ once plugged, and communication can be done with the Odoo Point of Sale module.
56
+
57
+ # Table of contents
58
+
59
+ 1. [Run](#run)
60
+ 2. [Usage](#usage)
61
+ 3. [Installation](#installation)
62
+ 4. [Related Odoo Modules](#related-odoo-modules)
63
+ 5. [Compatible Devices](#compatible-devices)
64
+ 6. [How to Contribute](#how-to-contribute)
65
+ 7. [Development](#development)
66
+ 7. [Roadmap and Known Issues](#roadmap-and-known-issues)
67
+ 8. [Credits](#credits)
68
+
69
+ ## <div id="run">Run</div>
70
+
71
+ ```shell
72
+ odoo-driver\
73
+ --address 0.0.0.0\
74
+ --port 8069\
75
+ --secure\
76
+ --refresh-devices-delay 1\
77
+ --log-level INFO\
78
+ --log-folder false\
79
+ --options EXTRA_OPTIONS
80
+ ```
81
+
82
+ (The values displayed above are the default values.
83
+
84
+ * ``-a / --address``: address where the web service will be available
85
+
86
+ * ``-p / --port``: port where the web service will be available
87
+
88
+ * ``--secure/--unsecure``: expose webservice with https
89
+ (or http, if ``--unsecure`` is selected).
90
+
91
+ * ``-r / --refresh-devices-delay``: interval in seconds
92
+ between two checks of devices connected to usb ports.
93
+
94
+ * ``-l / --log-level``: Possible values:
95
+ ``TRACE`` / ``DEBUG`` / ``INFO`` / ``SUCCESS`` /
96
+ ``WARNING`` / ``ERROR`` / ``CRITICAL``.
97
+ Note:
98
+ - ``TRACE`` will log all the http call.
99
+ - ``DEBUG`` will log all the data received, including images received by the
100
+ printer device.
101
+ - Use ``INFO`` level or higher in production outside a debugging situation.
102
+
103
+ * ``-f / --log-folder``: Optional directory that will contains logs.
104
+ If defined, it should exist and be writable.
105
+
106
+ * ``--options``: Json formatted data to pass to devices. Ex:
107
+ ``'{"scale": {"polynomial": 123456}}'``
108
+ That will pass the polynomial value to the scale device.
109
+ Note: don't forget the simple quote at the beginning and the end of the
110
+ dictionnary.
111
+
112
+ ## <div id="usage">Usage</div>
113
+
114
+ Go the home page of the tool, via https://localhost:8069.
115
+
116
+ If you choose https deployment, you should accept the first time
117
+ a security exception in your browser.
118
+
119
+ ![security_exception](https://gitlab.com/grap-rhone-alpes/odoo-driver/-/raw/main/odoo_driver/static/readme/security_exception.png)
120
+
121
+
122
+ Pages are available to test connections, see errors, etc.
123
+
124
+ ![home_page](https://gitlab.com/grap-rhone-alpes/odoo-driver/-/raw/main/odoo_driver/static/readme/home_page.png)
125
+
126
+ ## <div id="installation">Installation</div>
127
+
128
+ ### Installation (to run it manually)
129
+
130
+ * install the latest released version:
131
+
132
+ ```shell
133
+ pipx install odoo-driver
134
+ ```
135
+
136
+ * _or_ Install the latest version:
137
+
138
+ ```shell
139
+ pipx install git+https://gitlab.com/grap-rhone-alpes/odoo-driver.git
140
+ ```
141
+
142
+ Note: use ``--python python3.9`` (or higher) option, if your default python environment is under python 3.9 version.
143
+
144
+ ### Installation (as a service)
145
+
146
+ This will create a service (via systemd) that will execute odoo-driver in the background and launches at startup.
147
+
148
+ ```shell
149
+ wget https://gitlab.com/grap-rhone-alpes/odoo-driver/-/raw/main/install_debian.sh
150
+ # (OPTIONAL) adapt the installation script before execution
151
+ # adding specific argument in the call of odoo-driver in the .service file
152
+ sudo sh install_debian.sh
153
+ ```
154
+
155
+ Once installed, you can run the following system command.
156
+
157
+ ```shell
158
+ # Get status of the service
159
+ sudo systemctl status odoo-driver.service
160
+
161
+ # Follow the logs of the service
162
+ sudo journalctl -fu odoo-driver.service
163
+ ```
164
+
165
+ ## <div id="related-odoo-modules">Related Odoo Modules</div>
166
+
167
+ Compatibility of the library with Odoo Modules, depending on the version.
168
+
169
+ ### V16
170
+
171
+ - Printer (+ Cashbox): ``point_of_sale`` (Odoo CE)
172
+
173
+ - Display: [``pos_odoo_driver_display``](https://github.com/grap/odoo-addons-pos)
174
+
175
+ - Payment: [``pos_odoo_driver_payment``](https://github.com/grap/odoo-addons-pos)
176
+
177
+ - Scale: ``point_of_sale`` (Odoo CE)
178
+
179
+ ## <div id="compatible-devices">Compatible Devices</div>
180
+
181
+ <table style="width: 100%;">
182
+ <tbody>
183
+ <tr>
184
+ <th colspan="2"><h3>Printers</h3></th>
185
+ </tr>
186
+ <tr>
187
+ <td>
188
+ <li>
189
+ Epson - TM-T20II<br/>
190
+ Epson - TM-T20III
191
+ </li>
192
+ </td>
193
+ <td>
194
+ <img src="https://gitlab.com/grap-rhone-alpes/odoo-driver/-/raw/main/odoo_driver/static/devices/printer__epson__tm_t20.png" width="200" height="200" />
195
+ </td>
196
+ </tr>
197
+ <tr>
198
+ <th colspan="2"><h3>Display</h3></th>
199
+ </tr>
200
+ <tr>
201
+ <td>Aures - OCD 300</td>
202
+ <td>
203
+ <img src="https://gitlab.com/grap-rhone-alpes/odoo-driver/-/raw/main/odoo_driver/static/devices/display__aures__ocd_300.png" width="200" height="200" />
204
+ </td>
205
+ </tr>
206
+ <tr>
207
+ <th colspan="2"><h3>Payment Terminal</h3></th>
208
+ </tr>
209
+ <tr>
210
+ <td>Ingenico - Move/5000</td>
211
+ <td>
212
+ <img src="https://gitlab.com/grap-rhone-alpes/odoo-driver/-/raw/main/odoo_driver/static/devices/payment__ingenico__move_5000.png" width="200" height="200" />
213
+ </td>
214
+ </tr>
215
+ <tr>
216
+ <th colspan="2"><h3>Scale</h3></th>
217
+ </tr>
218
+ <tr>
219
+ <td>Mettler Toledo - Ariva S</td>
220
+ <td>
221
+ <img src="https://gitlab.com/grap-rhone-alpes/odoo-driver/-/raw/main/odoo_driver/static/devices/scale__mettler_toledo__ariva_s.png" width="200" height="200" />
222
+ </td>
223
+ </tr>
224
+ </tbody>
225
+ </table>
226
+
227
+ ## <div id="how-to-contribute">How to Contribute</div>
228
+
229
+ ### Welcome contributions
230
+
231
+ * If the project is not translated into your language,
232
+ you can propose a translation.
233
+
234
+ * If you've encountered a problem or bug that you've solved,
235
+ the patch will be very welcome !
236
+
237
+ ### Unwelcome contributions
238
+
239
+ Please **do not propose** a Merge Request before opening first an issue on gitlab,
240
+ if you want to add new feature, new devices, etc.
241
+
242
+ Maintaining a driver library is an impossible task if you don't own the device.
243
+ If the device or the feature you propose is not in the Roadmap of the GRAP company,
244
+ it will be refused, to avoid rising technical debt.
245
+
246
+ In that case, do not hesitate to fork the project, to implement your change
247
+ in a dedicated branch.
248
+
249
+ ## <div id="development">Development</div>
250
+
251
+ See the dedicated section [here](https://gitlab.com/grap-rhone-alpes/odoo-driver/-/blob/main/DEVELOP.md).
252
+
253
+ ## <div id="roadmap-and-known-issues">Roadmap and Known Issues</div>
254
+
255
+ See the dedicated section [here](https://gitlab.com/grap-rhone-alpes/odoo-driver/-/blob/main/ROADMAP.md).
256
+
257
+ ## <div id="credits">Credits</div>
258
+
259
+ ### Authors
260
+
261
+ * GRAP <https://www.grap.coop>
262
+
263
+ ### Contributors
264
+
265
+ * Sylvain LE GAL <sylvain.legal@grap.coop>
266
+
267
+ ### Extra authorship
268
+
269
+ Part of the code in this project comes from the following projects, including:
270
+
271
+ * [Pywebdriver](https://github.com/pywebdriver/pywebdriver) (AGPL-3.0), by GRAP. Main contributors are:
272
+
273
+ * Sylvain LE GAL <sylvain.legal@grap.coop>
274
+ * Sylvain CALADOR <sylvain.calador@akretion.com>
275
+ * Sébastien BEAU <sebastien.beau@akretion.com>
276
+ * Carmen BIANCA BAKKER <carmen@coopiteasy.be>
277
+ * Alexis DE LATTRE <alexis.delattre@akretion.com>
278
+ * Quentin DUPONT <quentin.dupont@grap.coop>
279
+ * Pierrick BRUN <pierrick.brun@akretion.com>
280
+ * Hugues DE KEYZER <hugues@coopiteasy.be>
281
+
282
+ * [hw_dialog06_scale](https://github.com/coopiteasy/iot/tree/12.0-dialog06/hw_dialog06_scale) (AGPL-3.0), by Coop It Easy. Main contributors are:
283
+
284
+ * Vincent Van Rossem <vincent.vanrossem@camptocamp.com>
285
+
286
+ * [pyposdisplay](https://github.com/akretion/pyposdisplay) (AGPL-3.0), by Akretion. Main contributors are:
287
+
288
+ * Alexis DE LATTRE <alexis.delattre@akretion.com>
289
+ * Sébastien BEAU <sebastien.beau@akretion.com>
290
+
291
+ The following projects were also useful and were studied to realize this library.
292
+
293
+ * [Odoo](https://github.com/odoo/odoo) (AGPL-3.0 up to version 8.0, and then LGPL-3.0 from version 9.0 onwards), by Odoo SA, specially "hw_" modules.
294
+
295
+ ### Images
296
+
297
+ * [Main Application icon](https://www.flaticon.com/fr/icones-gratuites/hub-usb), by AbtoCreative (Flaticon).
298
+
299
+ * [Credit Card Payment Terminal Icon](https://www.flaticon.com/fr/icone-gratuite/terminal-de-paiement_6137350), created by ToZ Icon (Flaticon).
300
+
301
+ * [LCD Customer Display Icon](https://www.flaticon.com/fr/icone-gratuite/lcd_9622586), created by Iconic Panda (Flaticon).
302
+
303
+ * [Thermal Receipt Printer Icon](https://www.flaticon.com/fr/icone-gratuite/facture_1649343), created by Icongeek26 (Flaticon).
304
+
305
+ * [Scale Icon](https://www.flaticon.com/fr/icone-gratuite/pesee_1104592), created by itim2101 (Flaticon).
306
+
@@ -0,0 +1,264 @@
1
+ ![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)
2
+ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/odoo-driver)
3
+ ![PyPI - Downloads](https://img.shields.io/pypi/dm/odoo-driver)
4
+ ![GitLab last commit](https://img.shields.io/gitlab/last-commit/60778766)
5
+ ![GitLab stars](https://img.shields.io/gitlab/stars/60778766?style=social)
6
+ [![Socket Badge](https://socket.dev/api/badge/pypi/package/odoo-driver)](https://socket.dev/pypi/package/odoo-driver)
7
+
8
+ # Odoo POS Driver
9
+
10
+ This tools is intented to be used with the Odoo Point of sale application. It replaces the Odoo [IoT Box](https://www.odoo.com/app/iot) or the
11
+ Community [pywebdriver](https://github.com/pywebdriver/pywebdriver) library.
12
+
13
+ Once installed locally in the cashier computer, devices will be discovered by the tool,
14
+ once plugged, and communication can be done with the Odoo Point of Sale module.
15
+
16
+ # Table of contents
17
+
18
+ 1. [Run](#run)
19
+ 2. [Usage](#usage)
20
+ 3. [Installation](#installation)
21
+ 4. [Related Odoo Modules](#related-odoo-modules)
22
+ 5. [Compatible Devices](#compatible-devices)
23
+ 6. [How to Contribute](#how-to-contribute)
24
+ 7. [Development](#development)
25
+ 7. [Roadmap and Known Issues](#roadmap-and-known-issues)
26
+ 8. [Credits](#credits)
27
+
28
+ ## <div id="run">Run</div>
29
+
30
+ ```shell
31
+ odoo-driver\
32
+ --address 0.0.0.0\
33
+ --port 8069\
34
+ --secure\
35
+ --refresh-devices-delay 1\
36
+ --log-level INFO\
37
+ --log-folder false\
38
+ --options EXTRA_OPTIONS
39
+ ```
40
+
41
+ (The values displayed above are the default values.
42
+
43
+ * ``-a / --address``: address where the web service will be available
44
+
45
+ * ``-p / --port``: port where the web service will be available
46
+
47
+ * ``--secure/--unsecure``: expose webservice with https
48
+ (or http, if ``--unsecure`` is selected).
49
+
50
+ * ``-r / --refresh-devices-delay``: interval in seconds
51
+ between two checks of devices connected to usb ports.
52
+
53
+ * ``-l / --log-level``: Possible values:
54
+ ``TRACE`` / ``DEBUG`` / ``INFO`` / ``SUCCESS`` /
55
+ ``WARNING`` / ``ERROR`` / ``CRITICAL``.
56
+ Note:
57
+ - ``TRACE`` will log all the http call.
58
+ - ``DEBUG`` will log all the data received, including images received by the
59
+ printer device.
60
+ - Use ``INFO`` level or higher in production outside a debugging situation.
61
+
62
+ * ``-f / --log-folder``: Optional directory that will contains logs.
63
+ If defined, it should exist and be writable.
64
+
65
+ * ``--options``: Json formatted data to pass to devices. Ex:
66
+ ``'{"scale": {"polynomial": 123456}}'``
67
+ That will pass the polynomial value to the scale device.
68
+ Note: don't forget the simple quote at the beginning and the end of the
69
+ dictionnary.
70
+
71
+ ## <div id="usage">Usage</div>
72
+
73
+ Go the home page of the tool, via https://localhost:8069.
74
+
75
+ If you choose https deployment, you should accept the first time
76
+ a security exception in your browser.
77
+
78
+ ![security_exception](https://gitlab.com/grap-rhone-alpes/odoo-driver/-/raw/main/odoo_driver/static/readme/security_exception.png)
79
+
80
+
81
+ Pages are available to test connections, see errors, etc.
82
+
83
+ ![home_page](https://gitlab.com/grap-rhone-alpes/odoo-driver/-/raw/main/odoo_driver/static/readme/home_page.png)
84
+
85
+ ## <div id="installation">Installation</div>
86
+
87
+ ### Installation (to run it manually)
88
+
89
+ * install the latest released version:
90
+
91
+ ```shell
92
+ pipx install odoo-driver
93
+ ```
94
+
95
+ * _or_ Install the latest version:
96
+
97
+ ```shell
98
+ pipx install git+https://gitlab.com/grap-rhone-alpes/odoo-driver.git
99
+ ```
100
+
101
+ Note: use ``--python python3.9`` (or higher) option, if your default python environment is under python 3.9 version.
102
+
103
+ ### Installation (as a service)
104
+
105
+ This will create a service (via systemd) that will execute odoo-driver in the background and launches at startup.
106
+
107
+ ```shell
108
+ wget https://gitlab.com/grap-rhone-alpes/odoo-driver/-/raw/main/install_debian.sh
109
+ # (OPTIONAL) adapt the installation script before execution
110
+ # adding specific argument in the call of odoo-driver in the .service file
111
+ sudo sh install_debian.sh
112
+ ```
113
+
114
+ Once installed, you can run the following system command.
115
+
116
+ ```shell
117
+ # Get status of the service
118
+ sudo systemctl status odoo-driver.service
119
+
120
+ # Follow the logs of the service
121
+ sudo journalctl -fu odoo-driver.service
122
+ ```
123
+
124
+ ## <div id="related-odoo-modules">Related Odoo Modules</div>
125
+
126
+ Compatibility of the library with Odoo Modules, depending on the version.
127
+
128
+ ### V16
129
+
130
+ - Printer (+ Cashbox): ``point_of_sale`` (Odoo CE)
131
+
132
+ - Display: [``pos_odoo_driver_display``](https://github.com/grap/odoo-addons-pos)
133
+
134
+ - Payment: [``pos_odoo_driver_payment``](https://github.com/grap/odoo-addons-pos)
135
+
136
+ - Scale: ``point_of_sale`` (Odoo CE)
137
+
138
+ ## <div id="compatible-devices">Compatible Devices</div>
139
+
140
+ <table style="width: 100%;">
141
+ <tbody>
142
+ <tr>
143
+ <th colspan="2"><h3>Printers</h3></th>
144
+ </tr>
145
+ <tr>
146
+ <td>
147
+ <li>
148
+ Epson - TM-T20II<br/>
149
+ Epson - TM-T20III
150
+ </li>
151
+ </td>
152
+ <td>
153
+ <img src="https://gitlab.com/grap-rhone-alpes/odoo-driver/-/raw/main/odoo_driver/static/devices/printer__epson__tm_t20.png" width="200" height="200" />
154
+ </td>
155
+ </tr>
156
+ <tr>
157
+ <th colspan="2"><h3>Display</h3></th>
158
+ </tr>
159
+ <tr>
160
+ <td>Aures - OCD 300</td>
161
+ <td>
162
+ <img src="https://gitlab.com/grap-rhone-alpes/odoo-driver/-/raw/main/odoo_driver/static/devices/display__aures__ocd_300.png" width="200" height="200" />
163
+ </td>
164
+ </tr>
165
+ <tr>
166
+ <th colspan="2"><h3>Payment Terminal</h3></th>
167
+ </tr>
168
+ <tr>
169
+ <td>Ingenico - Move/5000</td>
170
+ <td>
171
+ <img src="https://gitlab.com/grap-rhone-alpes/odoo-driver/-/raw/main/odoo_driver/static/devices/payment__ingenico__move_5000.png" width="200" height="200" />
172
+ </td>
173
+ </tr>
174
+ <tr>
175
+ <th colspan="2"><h3>Scale</h3></th>
176
+ </tr>
177
+ <tr>
178
+ <td>Mettler Toledo - Ariva S</td>
179
+ <td>
180
+ <img src="https://gitlab.com/grap-rhone-alpes/odoo-driver/-/raw/main/odoo_driver/static/devices/scale__mettler_toledo__ariva_s.png" width="200" height="200" />
181
+ </td>
182
+ </tr>
183
+ </tbody>
184
+ </table>
185
+
186
+ ## <div id="how-to-contribute">How to Contribute</div>
187
+
188
+ ### Welcome contributions
189
+
190
+ * If the project is not translated into your language,
191
+ you can propose a translation.
192
+
193
+ * If you've encountered a problem or bug that you've solved,
194
+ the patch will be very welcome !
195
+
196
+ ### Unwelcome contributions
197
+
198
+ Please **do not propose** a Merge Request before opening first an issue on gitlab,
199
+ if you want to add new feature, new devices, etc.
200
+
201
+ Maintaining a driver library is an impossible task if you don't own the device.
202
+ If the device or the feature you propose is not in the Roadmap of the GRAP company,
203
+ it will be refused, to avoid rising technical debt.
204
+
205
+ In that case, do not hesitate to fork the project, to implement your change
206
+ in a dedicated branch.
207
+
208
+ ## <div id="development">Development</div>
209
+
210
+ See the dedicated section [here](https://gitlab.com/grap-rhone-alpes/odoo-driver/-/blob/main/DEVELOP.md).
211
+
212
+ ## <div id="roadmap-and-known-issues">Roadmap and Known Issues</div>
213
+
214
+ See the dedicated section [here](https://gitlab.com/grap-rhone-alpes/odoo-driver/-/blob/main/ROADMAP.md).
215
+
216
+ ## <div id="credits">Credits</div>
217
+
218
+ ### Authors
219
+
220
+ * GRAP <https://www.grap.coop>
221
+
222
+ ### Contributors
223
+
224
+ * Sylvain LE GAL <sylvain.legal@grap.coop>
225
+
226
+ ### Extra authorship
227
+
228
+ Part of the code in this project comes from the following projects, including:
229
+
230
+ * [Pywebdriver](https://github.com/pywebdriver/pywebdriver) (AGPL-3.0), by GRAP. Main contributors are:
231
+
232
+ * Sylvain LE GAL <sylvain.legal@grap.coop>
233
+ * Sylvain CALADOR <sylvain.calador@akretion.com>
234
+ * Sébastien BEAU <sebastien.beau@akretion.com>
235
+ * Carmen BIANCA BAKKER <carmen@coopiteasy.be>
236
+ * Alexis DE LATTRE <alexis.delattre@akretion.com>
237
+ * Quentin DUPONT <quentin.dupont@grap.coop>
238
+ * Pierrick BRUN <pierrick.brun@akretion.com>
239
+ * Hugues DE KEYZER <hugues@coopiteasy.be>
240
+
241
+ * [hw_dialog06_scale](https://github.com/coopiteasy/iot/tree/12.0-dialog06/hw_dialog06_scale) (AGPL-3.0), by Coop It Easy. Main contributors are:
242
+
243
+ * Vincent Van Rossem <vincent.vanrossem@camptocamp.com>
244
+
245
+ * [pyposdisplay](https://github.com/akretion/pyposdisplay) (AGPL-3.0), by Akretion. Main contributors are:
246
+
247
+ * Alexis DE LATTRE <alexis.delattre@akretion.com>
248
+ * Sébastien BEAU <sebastien.beau@akretion.com>
249
+
250
+ The following projects were also useful and were studied to realize this library.
251
+
252
+ * [Odoo](https://github.com/odoo/odoo) (AGPL-3.0 up to version 8.0, and then LGPL-3.0 from version 9.0 onwards), by Odoo SA, specially "hw_" modules.
253
+
254
+ ### Images
255
+
256
+ * [Main Application icon](https://www.flaticon.com/fr/icones-gratuites/hub-usb), by AbtoCreative (Flaticon).
257
+
258
+ * [Credit Card Payment Terminal Icon](https://www.flaticon.com/fr/icone-gratuite/terminal-de-paiement_6137350), created by ToZ Icon (Flaticon).
259
+
260
+ * [LCD Customer Display Icon](https://www.flaticon.com/fr/icone-gratuite/lcd_9622586), created by Iconic Panda (Flaticon).
261
+
262
+ * [Thermal Receipt Printer Icon](https://www.flaticon.com/fr/icone-gratuite/facture_1649343), created by Icongeek26 (Flaticon).
263
+
264
+ * [Scale Icon](https://www.flaticon.com/fr/icone-gratuite/pesee_1104592), created by itim2101 (Flaticon).
@@ -0,0 +1,5 @@
1
+ from pathlib import Path
2
+
3
+ from single_source import get_version
4
+
5
+ __version__ = get_version(__name__, Path(__file__).parent.parent)
@@ -0,0 +1,29 @@
1
+ from flask import Flask, request
2
+ from flask_babel import Babel
3
+ from flask_cors import CORS
4
+
5
+ # Initialize Flask Application
6
+ app = Flask(__name__)
7
+
8
+ # Include extra route files
9
+ from . import flask_app # noqa: F401,E402
10
+
11
+ # Handle CORS call
12
+ CORS(app, resources={r"/*": {"origins": "*"}})
13
+
14
+ # Handle translation via babel
15
+ app.config["BABEL_DEFAULT_LOCALE"] = "en"
16
+ babel = Babel(app)
17
+
18
+
19
+ def get_locale():
20
+ # Use the browser's language preferences to select an available translation
21
+ available_translations = [
22
+ str(translation) for translation in babel.list_translations()
23
+ ]
24
+ for lang in request.accept_languages.values():
25
+ if lang[:2] in available_translations:
26
+ return lang[:2]
27
+
28
+
29
+ babel.init_app(app, locale_selector=get_locale)