Commit Graph
107 Commits
Author SHA1 Message Date
Antoine Prieels 07a495d52c [IMP] hw_drivers: Support for Star receipt printers
Add support for Star Line Mode protocol, used by most Star receipt
printers.

closes odoo/odoo#60371

Taskid: 2365648
X-original-commit: cd0545b98fc1e7a66dd46eb6a283736ef58ac4ff
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2020-10-20 13:15:34 +00:00
Antoine Prieels 585b5189fd [IMP] hw_drivers: Remove http.py.iotpatch
We used to patch http.py using a diff. This was really not practical
because every time the file was modified, the diff had to be recreated.
We now override the specific methods directly.

closes odoo/odoo#60366

X-original-commit: a6012f03ff02f04a3d128e33326f932fd22f0ced
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2020-10-20 11:40:23 +00:00
Antoine Prieels 2f7f9095d7 [FIX] hw_drivers: Don't crash if remount fails
We sometimes encountered IoT Boxes crashing because the remount failed.
As this isn't a big issue, we won't check the return value of the call
to `mount`.

closes odoo/odoo#59438

X-original-commit: 5f9874da0f5f5b27c546cd248d08299f0e65544b
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2020-10-07 15:44:11 +00:00
lejeune quentin c5f46533dd [FIX] point_of_sale: Fix path to nightly in IoT
The path to folder of images of IoT has change.

So we adapt the path for the upgrade of IoT

closes odoo/odoo#57978

X-original-commit: 9512a23f48176fe0e7970039c824281c4af18162
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2020-09-17 16:14:13 +00:00
lejeune quentin 7efa4ad92b [FIX] hw_drivers: Fix request to iot-proxy.odoo.com on AP mode
If IoT Box is on access point mode the box try to reach https://iot-proxy.odoo.com
to get pairing code. So the box try while 5 minutes to reach iot-proxy
and send request on network every 10 secondes.

Now we add a condition 'if not access_point()' to send these request.

closes odoo/odoo#57976

X-original-commit: 901dc987c0204a7df2b811bb430f31eabf204fbb
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2020-09-17 16:13:20 +00:00
lejeune quentin efa43fb618 [FIX] hw_drivers: Fix requests to iot-proxy
We make request to iot-proxy.odoo.com every 10 secondes
while 5 minutes.

But we have a traceback if we don't have a internet connection.
So we put a 'try except' to catch error

Related 841c016913a8

closes odoo/odoo#57567

X-original-commit: 3227490e270a1f5b98ef7811edca59e9aa1b6b55
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2020-09-11 15:46:35 +00:00
Antoine Prieels 8a0e1a3f01 [FIX] hw_drivers: Long receipts make receipt printer crash
When printing a long receipt from the POS, the printer crashed, printed
random characters and needed to be rebooted to print other receipts.

The problem was that there's a limitation of height when printing
images with ESC/POS (see [ESC/POS documentation](http://www.starmicronics.com/support/mannualfolder/escpos_cm_en.pdf), page 158).

We then split the image into slices and print slices with separate
commands.

closes odoo/odoo#57512

X-original-commit: ab06df30557af90f3e704d4cfc1e6da66f7708b7
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2020-09-11 11:10:00 +00:00
Antoine Prieels a7bbcd1360 hw_drivers: Stop devices threads on disconnect
The threads of devices were still running after `disconnect` had been
called. We add a `_stopped` flag that is set when the thread should be
stopped.

closes odoo/odoo#56500

X-original-commit: 639a4e4fc72567a9655599eef150fabefaf1ff2e
Related: odoo/enterprise#12651
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2020-08-25 11:24:56 +00:00
Antoine Prieels 72681dc53f [IMP] hw_*,point_of_sale: Cleaning IoT Box
- Split driver.py to multiple files
- Remove hw_proxy module as most of its routes were not used and
  move remaingin routes to a controller in hw_drivers
- Add missing coding and license lines at the beginning of files
- Reorder imports and remove unused ones
- Rename device_id to device_identifier for clarity
- Rename screen to display for consistency
- Other minors improvements

Taskid: 1973956
X-original-commit: 841c016913a87133bf7257c62ae5f6bf7d99e06d
2020-08-25 11:24:56 +00:00
Antoine Prieels 451a6dace3 [FIX] hw_drivers: Traceback in scanner type detection
`device_name` and `scanner_name` were defined outside of the scope of
the function where they were used in.
We move them and try to simplify the logic a bit.

closes odoo/odoo#56454

X-original-commit: e59e311578aa0b4539ef27580462a2c2e1dce970
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2020-08-24 17:41:05 +00:00
lejeune quentin f4ab72925f [IMP] iot: Add the possibility to switch between scanner and keyboard
Some scanner are detected like keyboard because they do not meet
     the conditions to be supported as a scanner by the driver.

    So we add the possibility to manually switch the type of device
    between scanner and keyboard.

closes odoo/odoo#56053

Related: odoo/enterprise#12370
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2020-08-21 15:31:35 +00:00
lejeune quentin e694d7f03e [FIX] iot: Add new protocol to detect Zebra pinter
Some network Zebra printer are not detected because
the protocol 'socket' is not supported.

Now we add this protocol in the 'supported' function

closes odoo/odoo#56146

X-original-commit: f7fa40bdbbd765caf8fe528fff949b4dccf3d8c2
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-08-19 13:41:10 +00:00
Antoine Prieels 6c97a9eb60 [FIX] hw_drivers, pos: Move IoTBox version file
We move the IoT Box version file from /home/pi to /var/odoo
so its not overriden after an auto-flash of the IoT Box.

closes odoo/odoo#54063

X-original-commit: ce0700ce401523267b5a8bd5665a368cfea24912
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2020-07-03 15:18:03 +00:00
Antoine Prieels 2761a2a127 [FIX] hw_drivers: Error on distant_display refresh
Trying to call display_refresh or update_url when no screen was
connected to the IoT Box and the default distant_display was created
resulted in an error.

closes odoo/odoo#53975

X-original-commit: 77768b93bc64d47abdbd4abd48c386acb293815e
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2020-07-02 11:52:36 +00:00
Antoine Prieels 852594473d [IMP] hw_drivers: IoT Box Connection
IoT Boxes that load the drivers from this version will always
use images that have the ConnectionManager.
The `try...excpect` is therefore not needed anymore.

closes odoo/odoo#50396

Taskid: 2246535
Related: odoo/upgrade#1407
Related: odoo/enterprise#10285
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-06-25 09:01:07 +00:00
Antoine Prieels c5e1af7a35 [FIX] hw_drivers: IoT Box connection
In Chrome 84, mixed content will be completely blocked for security
reasons ([see blog](https://blog.chromium.org/2019/10/no-more-mixed-messages-about-https.html))
Other browsers will probably follow in the next months.

As IoT Boxes don't have a valid certificate before connecting to a DB,
we used mixed passive content to communicate with the boxes.
This won't be possible anymore, and we have no possible way to
communicate directly from the browser to the box.

- When an IoT Box boots without registered DB, a unique code will be
 created with a validity of 5 minutes.
- This code will be shown on the customer display and printed on the
 status ticket.
- The box will call a route on odoo.com and a record will be created
 in odoo.com with the unique code.
- The user will have to enter the code manually in his DB to connect
 to the IoT Box, the DB will then contact odoo.com to search for a
 record containing the unique code. If it's found, the
 `openerp.enterprise.database` will be added to the record.
- The box will then query odoo.com at regular intervals (10 seconds)
 to check if a DB is linked to the code.

closes odoo/odoo#53623

Taskid: 2246535
X-original-commit: c55f12e32598a713105f3c049ac053e46ba15bb2
Related: odoo/enterprise#11421
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-06-25 06:08:33 +00:00
Martin Trigaux ba244cef01 [IMP] *: replace to new _() syntax
Using a few regex like
\((_\(.*%s.*)(\) % )([\w\[\]][\w .\[\]\(\)'"]*)\)
($1, $3))

Old syntax is still compatible but starts the migration to the new
syntax that catches error.
2020-06-18 13:03:34 +02:00
lejeune quentin 5a097e5c71 [FIX] hw_drivers: Fix issue with printer device-id
When we print a ticket status with a thermal printer we need printer's device-id
But if we add manually a printer this device-id doesn't exist
So now we update de devices list with a supported = True if
printer are manually added

closes odoo/odoo#53072

X-original-commit: 89bbc555ecf520ee34a9b1292a2bdb5c937b18e2
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2020-06-16 13:45:31 +00:00
lejeune quentin 7686e1bced [IMP] hw_drivers: Add possibility to add manually a printer to the IoT Box
The IoT Box detects printers automatically under certain conditions.
And so there are printers that are not detected by the box
and cannot be used in Odoo.
With this commit we give the possibility to add printers manually
with Cups and to be able to use them in Odoo.

closes odoo/odoo#52154

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2020-06-12 08:14:58 +00:00
lejeune quentin 9553871312 [FIX] hw_drivers: Restart Odoo after IoT has connected
When the route '/hw_drivers/box/connect' is called to connect an IoT Box to a DB,
the checkout on the branch of the DB is not performed and incompatibility can occur.

With this fix we relaunch Odoo via a parallel thread in order to be able to respond to the request...

closes odoo/odoo#52513

X-original-commit: 9aca7c464cef492c495a0c72d870b7075187dc63
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2020-06-05 14:00:06 +00:00
Antoine Prieels ec9759a6c0 [FIX] hw_drivers: Failed checkout and drivers loading
- The checkout to switch to the branch of the connected DB was not
processed correctly because the command used to clear the drivers
failed, raising an exception:

rm: cannot remove '/home/pi/odoo/addons/hw_drivers/drivers/__pycache__': Is a directory

- The location of the drivers has been changed in master. So, even if we
perform a checkout, the addons/hw_drivers/drivers directory doesn't
exist. The get_resource_path('hw_drivers', 'drivers') then returned
False instead of the correct path and the extraction of the zip file
failed.

closes odoo/odoo#52448

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2020-06-05 06:32:18 +00:00
Antoine Prieels 1454eed5b7 [FIX] hw_drivers,hw_escpos: Check pyusb version
The `get_string` method from the `pyusb` package has changed its
signature after version 1.0.0b1 so we used to force the IoT Box to use
this version to avoid an error. The problem is that version 1.0.0b1
has dependencies that raise DeprecationWarings in Raspbian Buster.
We then want to update the version of pyusb that is installed on the
IoT Box in 14.0.

As the Driver might be loaded to old versions of the IoT Box as well
as new ones, we need to check what version of the package is present
on the IoT Box before calling `get_string`.

This check will be removed in 14.0, as people will have to use the
latest version of the IoT Box.

closes odoo/odoo#52374

X-original-commit: e5475ae8ceca2121d15985ac7446f90dbd59b485
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2020-06-03 15:20:36 +00:00
Antoine Prieels e5d25e98b4 [IMP] hw_drivers: Give a priority order to drivers
Previously, we tested the `supported` methods of all drivers
sequentially in alphabetical order of file names. If you wanted to
extend a driver, the `supported` method of your driver could never be
tested if the one of its parent was tested first.

We've now added a priority order to drivers so that by default the
extending driver will always be tested before the extended driver.

You can still do something similar to what `is_tested_last` did by
manually setting the priority of a driver to 0.

Ex: The way barcode scanners is really similar to keyboards, but still
requires a few modifications in the driver. We couldn't extend the
keyboard driver easily because the supported method of barcode scanners
had to be more strict than the one of keyboards. If the
KeyboardUSBDriver was tested first, scanners were recognized as
keyboard and didn't have all the specific features of scanners.

TaskID: 2082282
2020-05-13 13:26:05 +00:00
Antoine Prieels e1c52c936d [IMP] hw_drivers: Easier detection of new devices
Until now, to detect new types of devices on the IoT Box, we had to
modify driver.py. If partners wanted to connect a new type of device,
they had to modify directly the files on the Box, meaning that after
each new build they had to re-apply all their modifications.

We remove the loops that detected the connected devices and replace
them by `Interfaces`. All interfaces will be loaded from the connected
Odoo instance with the corresponding drivers.

TaskID: 2082282
2020-05-13 13:26:05 +00:00
Antoine Prieels 312a6d5b03 [FIX] hw_drivers: typo in ExceptionLogger
Exceptions were not logged correctly due to a typo in ExceptionLogger.

closes odoo/odoo#51191

X-original-commit: 9ac2ad249bddc631de9a9d587058d6109918f584
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2020-05-13 15:12:41 +00:00
Antoine Prieels d2b172becd [FIX] hw_drivers: No devices after monitor disconnect
Steps to reproduce:
 - Start the IoT Box with a monitor plugged in
 - Unplug the monitor
 - Restart the Odoo service (i.e. connect the IoT Box to a DB)
 - No devices are detected

The problem came from the fact that `tvservice -l` and `tvservice -n`
have different behaviors when a monitor is disconnected:
 - `tvservice -l` still says that a device is attached
 - `tvservice -n` cannot detect the name of the device so it logs an
error to stderr but still has a return value of 0 so we read an empty
string from stdout.

The `get_connected_displays` function raised an exception because the
format of the returned string was not the one we excepted. The other
loops were then not started and no devices at all were detected.

closes odoo/odoo#50839

X-original-commit: ab6ec2ab6d30a86f9741da4b1986831772004d91
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2020-05-07 10:50:09 +00:00
Antoine Prieels 005eda5c34 [IMP] hw_drivers: Download IoT Box log file
Add a button to download the IoT Box log file from the Box form view in
the connected Odoo DB.

closes odoo/odoo#41093

Taskid: 1943418
Related: odoo/enterprise#6961
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-04-29 11:09:39 +00:00
lejeune quentin 672323037a [FIX] hw_drivers: Clean drivers folder before change branch
When we change the version of branch we keep drivers.
But drivers are not compatible with all branch and Odoo
on the IoT Box can't start.

So we remove all drivers before checkout on another branch

closes odoo/odoo#50140

X-original-commit: 4e97aec6717697c742e5e0b09f00ab7dec09712f
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-04-24 11:10:12 +00:00
Adrian Torres 5952928b42 [REM] *: remove various unused import shims
Before this commit, a lot of leftover import shims existed in the
codebase for py2-py3 compatibility, these are no longer needed since
Odoo 13.0+ doesn't support Python 2 anymore and is (finally) in EOL.

With this commit, these shims are dropped, making the code cleaner,
easier to read and with one less dependency.

Queue -> queue -> py2-py3 compatibility
xmlrpclib -> xmlrpc.client -> py2-py3 compatibility
ConfigParser -> configparser -> py2-py3 compatibility
itertools.izip_longest -> itertools.zip_longest -> py2-py3 compatibility
urllib -> urllib.request -> py2-py3 compatibility
__builtins__ -> builtins -> py2-py3 compatibility
_winreg -> winreg -> py2-py3 compatibility

mock -> unittest.mock -> merged into CPython

The debian/fedora packages and requirements.txt have been updated accordingly

closes odoo/odoo#44601

Related: odoo/enterprise#8141
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-04-01 12:45:40 +00:00
Antoine Prieels 6413ef6955 [REV] hw_drivers, hw_posbox_homepage, pos: Remove MPD
This reverts commit 9d43308a8f6b521d3d18f7fc472303f58f56a0c3.

No one should be using MPD in production at the moment but
we'll still leave it in the buiold of the Box, just to be sure.

X-original-commit: 129101815d5846d5b53148546b19bdd791f22aac
2020-03-23 09:29:52 +00:00
lejeune quentin ee519c222f [REF] hw_posbox_homepage: Use helpers to get mac address in homepage
We use a library to get mac address of IoT in homepage.

however we already have a function that does this in the helper in hw_drivers

closes odoo/odoo#46631

X-original-commit: ae78e9cdde777ffac6f08a35dd00a540c92130bb
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2020-03-02 09:01:11 +00:00
Antoine Prieels cad11eed98 [FIX] hw_drivers: Read weight from IoT Scale
We had two issues when reading the weight from a scale connected to
the IoT Box :

When using the '/hw_proxy/scale_read' route, if the same weight was
read twice, the value in PoS was reset to 0.
If the product was placed on the scale before opening the weight
screen, the weight was never read.

closes odoo/odoo#46432

X-original-commit: a08c5157f0b042e2ee250fc7b431b90451c7781a
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2020-02-27 12:36:27 +00:00
Antoine Prieels a200c6ddf8 [REM] hw_drivers, hw_posbox_homepage, pos: Remove MPD
Remove the MPD server and Six configuration from the IoT Box.
MPD will be replaced by TIM, which doesn't require the IoT Box.

closes odoo/odoo#46424

Taskid: 2188566
X-original-commit: 9d43308a8f6b521d3d18f7fc472303f58f56a0c3
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2020-02-27 11:17:15 +00:00
lejeune quentin 314410458b [FIX] hw_drivers: In IoT update route list after loading driver
For update correctly the route list of IoT after loading driver
we need set 'http.addons_manifest' to a empty json

Linked to 97c09e1c77284836c7c46b4e70d4f12eb48ce91b

Reboot not needed after a update

Linked to b77486753b7ae220a531ee09c529fb5eb944b0e2
Linked to 181a62cb57e143611ca1fbf0779cfd041d2a3cf8

closes odoo/odoo#46386

X-original-commit: 87b127efed97c1f6fad18d6ee6b5924a9b2c70f2
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2020-02-26 17:32:05 +00:00
lejeune quentin 17c181ac74 [FIX] hw_drievrs: Replace SSID on the first boot
We replace the SSID of the IoTBox with a unique SSID

closes odoo/odoo#46255

X-original-commit: c847c1cb149e386331ff2e5b19a58862e1b66714
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2020-02-25 14:08:49 +00:00
lejeune quentin fff277a4a7 [FIX] hw_drivers: Do not send request if the IoT is in access point
If IoT Box is in access point mode and a server is configured
the box try to reach the server.
But in access point mode all requests are redirected to the box

So now before return True in function 'get_odoo_server_url'
we verify if the service 'hostapd' is inactive

closes odoo/odoo#46141

X-original-commit: 365f0e384630bad16e0872d2307702fca5a4e295
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2020-02-24 16:03:12 +00:00
lejeune quentin e8611b363a [IMP] point_of_sale: Add the possibility to the IoT Box to perform a self-flashing
To be able to flash the partition on which the IoT Box is executed,
we must create a third partition and install an OS there to be able
to boot on it and flash the partition of the IoT Box

- Creation of the third partition
- Raspbian download and checksum verification
- Installation of Raspbian on the third partition
- Download the IoT image on the Raspbian partition and check the checksum
- Reboot on the Raspbian partition
- Installation of the IoT image on the second partition
- Reboot on the IoT partition
- Cleaning and deleting the third partition

closes odoo/odoo#44430

Task: 2161955
X-original-commit: 407d9a88a3d23ed49ed5a2c5fa4d211cec43edfd
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2020-01-31 18:34:02 +00:00
Pierre Masereel d66553cafd [FIX] hw_drivers: reload routes after loading drivers
closes odoo/odoo#44263

X-original-commit: 97c09e1c77284836c7c46b4e70d4f12eb48ce91b
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-01-30 10:02:25 +00:00
Antoine Prieels 3006636820 [FIX] hw_drivers: KeyboardUSBDriver: pedals not working
Pedals plugged in the IoT Box were not sending any data to the
connected Odoo DB.

The name of the device couldn't be retrieved, and the pedals were given
the default name "Unknown keyboard or scanner".

Since this default name included "scanner", the device was recognized
as a barcode scanner and no data was sent until Enter was pressed,
which never happened.

closes odoo/odoo#43914

X-original-commit: dba811f67439807a67749e6a41dbf92f4060a326
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2020-01-24 11:44:53 +00:00
Joren Van Onder e1a99b5027 [FIX] hw_drivers: read modifier keys in the event loop
Key input is handled in an evdev event loop. Before this commit the
state of modifier keys like shift, caps lock, ... were read when the
event was being processed. This doesn't always work because the evdev
events are processed asynchronously, i.e. when key A is being processed
in Python key B may have already been pressed.

Some devices that type fast, notably the Magtek card reader, this leads
to modifiers being applied to the wrong characters. Here's an example
before the patch:

5895000020000006^TEST/VAnTIV^251200000000000000?;4895000020000006=251200
000000000/\0600\0dD15ac71B75BA468E51F4e657529ADF6E3BDAC0A86A59B7adA12029
22F64BB55E74880A1908AD08AFC9372ADe21FD1E74D409C912C1A5|5C3D07B727DE46DaF
B6D8ED2007DB219F49FAC1311F0fa01474FC5BC621F33F915BE77D8DAF5E69A||6140300
0|076C0B3B0704CD78D7CF7Dc5B2ED3F0Ca3ad2e6c88d1F2310B7DB96973b4D556c2f9e4
016C60a7DB581990567FE5656E02C27276FA43BFE|B2ECCDE070215AA|336a4f78bb3c4C
\901209b2eCde000f3\4fC\100

This is what it looks like after the patch:

%B4895000020000006^TEST/VANTIV^251200000000000000?;4895000020000006=2512
00000000000?|0600|FE511F7BA7C38A4FA85D0135E58DDC798E557819356DADA132ECBE
D95184CCC77D7E2B1AE7E8AB076488B9757CA2A046C70590D01FA86217|5DAFE6EC44372
A3EF0358D42D08D9246DD8D2837150954B758199207697EFEB08A71B38B2E1690CE||614
03000|584CB8EBE3B17D2828C3B010DFB4E63E9F5036705CF7E547707DC75A9408E958DC
A3052B03031EA0F3B1F1163E40EF3F542B70F9FFD7912D|B2ECCDE070215AA|21352532D
D6E7334|90CDE0001FA|06A6||1000

These are some of the issues visible in the above example:
- there's a 5 instead of a % (on QWERTY SHIFT-5 is %)
- the n in VAnTIV is lowercase
- there's many /'s which should be ? (on QWERTY SHIFT-/ is ?)
- there's many \'s which should be | (once again on QWERTY SHIFT-\ is |)

To solve the issue, we read the state of the modifiers in the same event
loop.

opw-2122553

closes odoo/odoo#42767

X-original-commit: caa4c7ef6d23f695827b58e60a013a9438eb67cf
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2020-01-06 13:54:07 +00:00
Joren Van Onder d8b384e6cd [FIX] hw_drivers: detect Magtek card reader as a barcode reader
It behaves exactly the same as a barcode reader, and pos_mercury uses
the barcode nomenclature to make it work. For reference, the full name
is:

Mag-Tek - USB Swipe Reader

opw-2122553

X-original-commit: 635f1ea8527f4489b8c56b5d18856c7d2c60737e
2020-01-06 13:54:06 +00:00
Antoine Prieels 6e07e0b4b0 [FIX] hw_drivers: Use branch of connected DB
Preivously, the code of the IoT Box was retrieved from the branch that
was used during the build but the drivers were retrieved from the
connected Odoo DB. Both could be in different versions, which forced
used to make old drivers compatible with the new Box or new drivers
compatible with old versions of the Box.

All of this made it quite hard to modify the existing code, even for
new versions of the Box in master.

When connecting the IoT Box to an Odoo DB, we now retrieve the version
of Odoo that is used and checkout the Box to this branch. This means
that we can now modify the code of the Box in master without having to
worry about users using the latest build with older DBs.

Taskid: 2120749
X-original-commit: 6af5d669593a4f431d14fce08c6151932f97da82
2019-11-26 12:31:37 +00:00
lejeune quentin ef09a4f44e [FIX] hw_drivers: Fix printer unknow in PrinterDriver
We add a condition to add printer.
Printer, for protocol DNSSD and LPD, must have a "model"

closes odoo/odoo#41591

X-original-commit: a07f118fc7182fa96344fad4a0164ed86c446352
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-12-09 12:47:59 +00:00
lejeune quentin 4bb7fa19f1 [FIX] hw_drivers: Fix detction method for printer
Actual IoT Box not detect correctly Epson TM-T88v.
Now we can detect printer even if name is 'Unknow'

closes odoo/odoo#41563

Taskid: 2153108
X-original-commit: 4c7a1d7a9ba2ad0fbdd92b3a73b0d6294cb6e4a3
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-12-09 09:56:47 +00:00
lejeune quentin 5caa5d7d2e [IMP] hw_drivers: Change IoT Box version
Change the version of the IoT Box.
From 19_10 to 19_12

closes odoo/odoo#41109

X-original-commit: 2b8779dc657a5a2b877ad2a552dd0dfda0071357
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-11-29 10:23:15 +00:00
Antoine Prieels 6f645925a4 [IMP] hw_drivers: Clean MPD manager in driver.py
We clean the code for the MPDManager by removing useless lines and
simplifying the way we run the MPD server.

closes odoo/odoo#40892

Related: odoo/enterprise#6892
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-11-28 14:04:33 +00:00
Antoine Prieels 2e34d456e8 [FIX] hw_drivers: Redirect exceptions to log file
Exceptions were logged to stderr so we couldn't see them when Odoo was
running as a service on the IoT Box. We now redirect stderr to the logger
to see track errors in the log file too.

closes odoo/odoo#41028

Taskid: 2146835
X-original-commit: 54a1919cbc37f5832ce110605c29b222c7a5bfe9
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2019-11-28 08:32:28 +00:00
Antoine Prieels 738868a1db [IMP] hw_drivers: Dual customer display
Customer displays were all using the same URL and therefore could only
show the same products. We now use different URLs per screen.

Two screens connected to the same IoT Box can now display customer
displays from different POS.

closes odoo/odoo#41026

Taskid: 2123511
X-original-commit: 12569b0e7f7a9e447f8df908597131911c5cfef8
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2019-11-27 14:15:18 +00:00
Antoine Prieels ad846fcee5 [IMP] iot: Dual screen support for RPI4
We now support the RPI4 which has 2 micro-HDMI outputs, while the
prvious driver only supported one display. We add support for a second
display.

Taskid: 2123511
X-original-commit: 5886c3a864c990fcd7b852baafab752e7da90494
2019-11-27 14:15:18 +00:00
Antoine Prieels 53bc9dcdc6 [FIX] hw_drivers: Print status ESC/POS printers
The status ticket contains ESC/POS commands but was printed on all
printers connected in USB. Plugging a printer that doesn't support
ESC/POS resulted in undefined behaviors.

We now only print this status ticket on ESC/POS printers.

closes odoo/odoo#40972

X-original-commit: c6a28b627cbe6f8bd1da4321c1329cbc1bde498d
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2019-11-27 09:18:33 +00:00