From 3f80ac603751f7f84c8c55d9ef21838350954335 Mon Sep 17 00:00:00 2001 From: Daniel Reis Date: Fri, 19 Jun 2026 08:42:51 +0100 Subject: [PATCH] [ADD] pos_pywebdriver: support pywebdriver printing, even in Enterprise installs --- pos_pywebdriver/README.rst | 196 ++++++ pos_pywebdriver/__init__.py | 1 + pos_pywebdriver/__manifest__.py | 25 + pos_pywebdriver/models/__init__.py | 2 + pos_pywebdriver/models/pos_config.py | 52 ++ pos_pywebdriver/models/res_config_settings.py | 17 + pos_pywebdriver/pyproject.toml | 3 + pos_pywebdriver/readme/CONFIGURE.md | 11 + pos_pywebdriver/readme/CONTRIBUTORS.md | 1 + pos_pywebdriver/readme/DESCRIPTION.md | 20 + pos_pywebdriver/readme/INSTALL.md | 27 + pos_pywebdriver/readme/USAGE.md | 25 + pos_pywebdriver/static/description/index.html | 566 ++++++++++++++++++ .../hardware_proxy_patch.esm.js | 31 + pos_pywebdriver/views/pos_config_views.xml | 66 ++ 15 files changed, 1043 insertions(+) create mode 100644 pos_pywebdriver/README.rst create mode 100644 pos_pywebdriver/__init__.py create mode 100644 pos_pywebdriver/__manifest__.py create mode 100644 pos_pywebdriver/models/__init__.py create mode 100644 pos_pywebdriver/models/pos_config.py create mode 100644 pos_pywebdriver/models/res_config_settings.py create mode 100644 pos_pywebdriver/pyproject.toml create mode 100644 pos_pywebdriver/readme/CONFIGURE.md create mode 100644 pos_pywebdriver/readme/CONTRIBUTORS.md create mode 100644 pos_pywebdriver/readme/DESCRIPTION.md create mode 100644 pos_pywebdriver/readme/INSTALL.md create mode 100644 pos_pywebdriver/readme/USAGE.md create mode 100644 pos_pywebdriver/static/description/index.html create mode 100644 pos_pywebdriver/static/src/hardware_proxy_patch/hardware_proxy_patch.esm.js create mode 100644 pos_pywebdriver/views/pos_config_views.xml diff --git a/pos_pywebdriver/README.rst b/pos_pywebdriver/README.rst new file mode 100644 index 0000000000..5dc76cac4a --- /dev/null +++ b/pos_pywebdriver/README.rst @@ -0,0 +1,196 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +=========================== +POS PyWebDriver Integration +=========================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:52ffe98ada0d1b8d9a5a25832cf759d3c861f2a9dc691bf2f6b22343ee06be71 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github + :target: https://github.com/OCA/pos/tree/19.0/pos_pywebdriver + :alt: OCA/pos +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/pos-19-0/pos-19-0-pos_pywebdriver + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/pos&target_branch=19.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module enables Odoo 19 Point of Sale to print receipts via a +`PyWebDriver `__ proxy, as +an alternative to the IoT Box. + +PyWebDriver is an open-source Python service that exposes the same +``/hw_proxy/`` HTTP endpoints as the Odoo IoT Box, allowing direct +ESC/POS printing without proprietary hardware. + +Key features: + +- Adds a **PyWebDriver** section to POS Settings, independent of the + IoT Box configuration. +- Mutually exclusive with IoT Box: enabling PyWebDriver mode disables + ``pos_iot``, and vice versa. +- Remaps the ``escpos`` driver key returned by PyWebDriver's + ``status_json`` to the ``printer`` key expected by Odoo 19, so the + connection status indicator works correctly. +- Uses Odoo's built-in ``HWPrinter`` (no custom printer logic needed). +- Works on Odoo Community and Enterprise Editions (the latter may + install the incompatible ``pos_iot`` module). + +**Table of contents** + +.. contents:: + :local: + +Installation +============ + +PyWebDriver +----------- + +Install and start +`PyWebDriver `__ on the +machine connected to the ESC/POS printer. Refer to the `PyWebDriver +documentation `__ for +installation and configuration instructions. + +HTTPS requirement +----------------- + +In production (Odoo served over HTTPS), PyWebDriver must also run on +HTTPS to avoid mixed-content blocking by the browser. + +The PyWebDriver Windows installer includes +``generate_certificates.bat``, which: + +1. Installs the local CA into the OS/browser trust store + (``mkcert -install``) +2. Generates locally-trusted certificates for ``localhost``, + ``127.0.0.1``, and ``::1`` + +Run ``generate_certificates.bat`` once after installation. The generated +``localhost+2.pem`` and ``localhost+2-key.pem`` are already referenced +in ``config\config.ini``. Set ``pywebdriver_ip`` in POS settings to +``https://127.0.0.1:``. + +pos_iot +------- + +This module is **incompatible** with ``pos_iot``. If ``pos_iot`` is +installed, uninstall it before enabling PyWebDriver mode on any POS +configuration. + +Configuration +============= + +1. Go to **Point of Sale → Configuration → Settings** and select your + POS. +2. Ensure **IoT Box** is **not** checked. +3. Under the **PyWebDriver** section, enable **Enable PyWebDriver**. +4. Set the **Proxy IP Address** to the URL where PyWebDriver is + listening (default: ``https://127.0.0.1:8069``). +5. Save. + +.. + + **Note:** Enabling **IoT Box** will automatically disable + PyWebDriver, and enabling PyWebDriver will automatically disable IoT + Box. They cannot be active at the same time. + +Usage +===== + +Once configured, open the POS session. The proxy connection is +established automatically on startup. + +Status Indicator +---------------- + +The network status indicator in the POS navbar shows the proxy +connection state: + +- **Green sitemap icon** — connected to PyWebDriver, printer ready. +- **Spinning icon** — connecting. +- **Red sitemap icon** — disconnected; check that PyWebDriver is + running and the IP address is correct. + +Printing +-------- + +Use the **Print Receipt** button as normal. Receipts are rendered as +JPEG images and sent to PyWebDriver via +``/hw_proxy/default_printer_action``. + +Troubleshooting +--------------- + ++----------------------------------+----------------------------------+ +| Symptom | Likely cause | ++==================================+==================================+ +| Status indicator stays | PyWebDriver not running, or | +| disconnected | wrong IP/port in settings | ++----------------------------------+----------------------------------+ +| "Printing failed — unknown | PyWebDriver reachable but | +| error" | printer not responding; check | +| | ESC/POS connection | ++----------------------------------+----------------------------------+ +| Browser print dialog opens | ``use_pywebdriver`` not saved, | +| instead | or session cache stale — reload | +| | the POS page | ++----------------------------------+----------------------------------+ + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Open Source Integrators + +Contributors +------------ + +- Daniel Reis dreis@opensourceintegrators.com + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/pos `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/pos_pywebdriver/__init__.py b/pos_pywebdriver/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/pos_pywebdriver/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/pos_pywebdriver/__manifest__.py b/pos_pywebdriver/__manifest__.py new file mode 100644 index 0000000000..add924170e --- /dev/null +++ b/pos_pywebdriver/__manifest__.py @@ -0,0 +1,25 @@ +# Copyright 2026 Open Source Integrators +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + +{ + "name": "POS PyWebDriver Integration", + "version": "19.0.1.0.0", + "category": "Point of Sale", + "summary": "Print POS receipts via PyWebDriver proxy instead of IoT Box", + "author": "Open Source Integrators, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/pos", + "license": "LGPL-3", + "depends": ["point_of_sale"], + "excludes": ["pos_iot"], + "data": [ + "views/pos_config_views.xml", + ], + "assets": { + "point_of_sale._assets_pos": [ + "pos_pywebdriver/static/src/**/*.esm.js", + ], + }, + "installable": True, + "auto_install": False, + "application": False, +} diff --git a/pos_pywebdriver/models/__init__.py b/pos_pywebdriver/models/__init__.py new file mode 100644 index 0000000000..2b92809a3b --- /dev/null +++ b/pos_pywebdriver/models/__init__.py @@ -0,0 +1,2 @@ +from . import pos_config +from . import res_config_settings diff --git a/pos_pywebdriver/models/pos_config.py b/pos_pywebdriver/models/pos_config.py new file mode 100644 index 0000000000..76a7e4e427 --- /dev/null +++ b/pos_pywebdriver/models/pos_config.py @@ -0,0 +1,52 @@ +# Copyright 2026 Open Source Integrators +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + +from odoo import api, fields, models +from odoo.exceptions import ValidationError + + +class PosConfig(models.Model): + _inherit = "pos.config" + + use_pywebdriver = fields.Boolean( + string="Use PyWebDriver", + help="Connect receipt printer via a PyWebDriver proxy instead of IoT Box.", + default=False, + ) + pywebdriver_ip = fields.Char( + string="PyWebDriver IP Address", + help="URL of the PyWebDriver proxy, e.g. https://127.0.0.1:8069", + default="https://127.0.0.1:8069", + ) + + @api.constrains("is_posbox", "use_pywebdriver") + def _check_pywebdriver_iot_exclusive(self): + for rec in self: + if rec.is_posbox and rec.use_pywebdriver: + raise ValidationError( + self.env._( + "IoT Box and PyWebDriver cannot both be enabled on " + "the same POS." + ) + ) + + def write(self, vals): + # Auto-clear the other flag when one is enabled for better UX. + if vals.get("use_pywebdriver"): + vals.setdefault("is_posbox", False) + if vals.get("is_posbox"): + vals.setdefault("use_pywebdriver", False) + return super().write(vals) + + @api.model + def _load_pos_data_read(self, records, config): + """When use_pywebdriver is enabled, shim the standard proxy fields so + the POS JS connects via PyWebDriver. is_posbox=True is required for the + useProxy getter.""" + read_records = super()._load_pos_data_read(records, config) + if read_records and config.use_pywebdriver and config.pywebdriver_ip: + record = read_records[0] + record["proxy_ip"] = config.pywebdriver_ip + record["is_posbox"] = True # required for useProxy getter + record["iface_print_via_proxy"] = True + return read_records diff --git a/pos_pywebdriver/models/res_config_settings.py b/pos_pywebdriver/models/res_config_settings.py new file mode 100644 index 0000000000..1640c5309a --- /dev/null +++ b/pos_pywebdriver/models/res_config_settings.py @@ -0,0 +1,17 @@ +# Copyright 2026 Open Source Integrators +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + +from odoo import fields, models + + +class ResConfigSettings(models.TransientModel): + _inherit = "res.config.settings" + + pos_use_pywebdriver = fields.Boolean( + related="pos_config_id.use_pywebdriver", + readonly=False, + ) + pos_pywebdriver_ip = fields.Char( + related="pos_config_id.pywebdriver_ip", + readonly=False, + ) diff --git a/pos_pywebdriver/pyproject.toml b/pos_pywebdriver/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/pos_pywebdriver/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/pos_pywebdriver/readme/CONFIGURE.md b/pos_pywebdriver/readme/CONFIGURE.md new file mode 100644 index 0000000000..647d00d750 --- /dev/null +++ b/pos_pywebdriver/readme/CONFIGURE.md @@ -0,0 +1,11 @@ +1. Go to **Point of Sale → Configuration → Settings** and select your + POS. +2. Ensure **IoT Box** is **not** checked. +3. Under the **PyWebDriver** section, enable **Enable PyWebDriver**. +4. Set the **Proxy IP Address** to the URL where PyWebDriver is + listening (default: `https://127.0.0.1:8069`). +5. Save. + +> **Note:** Enabling **IoT Box** will automatically disable PyWebDriver, +> and enabling PyWebDriver will automatically disable IoT Box. They +> cannot be active at the same time. diff --git a/pos_pywebdriver/readme/CONTRIBUTORS.md b/pos_pywebdriver/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..837de373e4 --- /dev/null +++ b/pos_pywebdriver/readme/CONTRIBUTORS.md @@ -0,0 +1 @@ +* Daniel Reis diff --git a/pos_pywebdriver/readme/DESCRIPTION.md b/pos_pywebdriver/readme/DESCRIPTION.md new file mode 100644 index 0000000000..765bcc94c1 --- /dev/null +++ b/pos_pywebdriver/readme/DESCRIPTION.md @@ -0,0 +1,20 @@ +This module enables Odoo 19 Point of Sale to print receipts via a +[PyWebDriver](https://github.com/pywebdriver/pywebdriver) proxy, as an +alternative to the IoT Box. + +PyWebDriver is an open-source Python service that exposes the same +`/hw_proxy/` HTTP endpoints as the Odoo IoT Box, allowing direct +ESC/POS printing without proprietary hardware. + +Key features: + +- Adds a **PyWebDriver** section to POS Settings, independent of the + IoT Box configuration. +- Mutually exclusive with IoT Box: enabling PyWebDriver mode disables + `pos_iot`, and vice versa. +- Remaps the `escpos` driver key returned by PyWebDriver's + `status_json` to the `printer` key expected by Odoo 19, so the + connection status indicator works correctly. +- Uses Odoo's built-in `HWPrinter` (no custom printer logic needed). +- Works on Odoo Community and Enterprise Editions + (the latter may install the incompatible `pos_iot` module). diff --git a/pos_pywebdriver/readme/INSTALL.md b/pos_pywebdriver/readme/INSTALL.md new file mode 100644 index 0000000000..05359b2ee6 --- /dev/null +++ b/pos_pywebdriver/readme/INSTALL.md @@ -0,0 +1,27 @@ +## PyWebDriver + +Install and start [PyWebDriver](https://github.com/pywebdriver/pywebdriver) +on the machine connected to the ESC/POS printer. Refer to the +[PyWebDriver documentation](https://github.com/pywebdriver/pywebdriver#readme) +for installation and configuration instructions. + +## HTTPS requirement + +In production (Odoo served over HTTPS), PyWebDriver must also run on HTTPS to +avoid mixed-content blocking by the browser. + +The PyWebDriver Windows installer includes `generate_certificates.bat`, which: + +1. Installs the local CA into the OS/browser trust store (`mkcert -install`) +2. Generates locally-trusted certificates for `localhost`, `127.0.0.1`, and `::1` + +Run `generate_certificates.bat` once after installation. The generated +`localhost+2.pem` and `localhost+2-key.pem` are already referenced in +`config\config.ini`. Set `pywebdriver_ip` in POS settings to +`https://127.0.0.1:`. + +## pos_iot + +This module is **incompatible** with `pos_iot`. If `pos_iot` is +installed, uninstall it before enabling PyWebDriver mode on any POS +configuration. diff --git a/pos_pywebdriver/readme/USAGE.md b/pos_pywebdriver/readme/USAGE.md new file mode 100644 index 0000000000..bd65c180d9 --- /dev/null +++ b/pos_pywebdriver/readme/USAGE.md @@ -0,0 +1,25 @@ +Once configured, open the POS session. The proxy connection is +established automatically on startup. + +## Status Indicator + +The network status indicator in the POS navbar shows the proxy +connection state: + +- **Green sitemap icon** — connected to PyWebDriver, printer ready. +- **Spinning icon** — connecting. +- **Red sitemap icon** — disconnected; check that PyWebDriver is running + and the IP address is correct. + +## Printing + +Use the **Print Receipt** button as normal. Receipts are rendered as +JPEG images and sent to PyWebDriver via `/hw_proxy/default_printer_action`. + +## Troubleshooting + +| Symptom | Likely cause | +|---|---| +| Status indicator stays disconnected | PyWebDriver not running, or wrong IP/port in settings | +| "Printing failed — unknown error" | PyWebDriver reachable but printer not responding; check ESC/POS connection | +| Browser print dialog opens instead | `use_pywebdriver` not saved, or session cache stale — reload the POS page | diff --git a/pos_pywebdriver/static/description/index.html b/pos_pywebdriver/static/description/index.html new file mode 100644 index 0000000000..fe7ccc88f2 --- /dev/null +++ b/pos_pywebdriver/static/description/index.html @@ -0,0 +1,566 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

POS PyWebDriver Integration

+ +

Beta License: LGPL-3 OCA/pos Translate me on Weblate Try me on Runboat

+

This module enables Odoo 19 Point of Sale to print receipts via a +PyWebDriver proxy, as +an alternative to the IoT Box.

+

PyWebDriver is an open-source Python service that exposes the same +/hw_proxy/ HTTP endpoints as the Odoo IoT Box, allowing direct +ESC/POS printing without proprietary hardware.

+

Key features:

+
    +
  • Adds a PyWebDriver section to POS Settings, independent of the +IoT Box configuration.
  • +
  • Mutually exclusive with IoT Box: enabling PyWebDriver mode disables +pos_iot, and vice versa.
  • +
  • Remaps the escpos driver key returned by PyWebDriver’s +status_json to the printer key expected by Odoo 19, so the +connection status indicator works correctly.
  • +
  • Uses Odoo’s built-in HWPrinter (no custom printer logic needed).
  • +
  • Works on Odoo Community and Enterprise Editions (the latter may +install the incompatible pos_iot module).
  • +
+

Table of contents

+ +
+

Installation

+
+

PyWebDriver

+

Install and start +PyWebDriver on the +machine connected to the ESC/POS printer. Refer to the PyWebDriver +documentation for +installation and configuration instructions.

+
+
+

HTTPS requirement

+

In production (Odoo served over HTTPS), PyWebDriver must also run on +HTTPS to avoid mixed-content blocking by the browser.

+

The PyWebDriver Windows installer includes +generate_certificates.bat, which:

+
    +
  1. Installs the local CA into the OS/browser trust store +(mkcert -install)
  2. +
  3. Generates locally-trusted certificates for localhost, +127.0.0.1, and ::1
  4. +
+

Run generate_certificates.bat once after installation. The generated +localhost+2.pem and localhost+2-key.pem are already referenced +in config\config.ini. Set pywebdriver_ip in POS settings to +https://127.0.0.1:<port>.

+
+
+

pos_iot

+

This module is incompatible with pos_iot. If pos_iot is +installed, uninstall it before enabling PyWebDriver mode on any POS +configuration.

+
+
+
+

Configuration

+
    +
  1. Go to Point of Sale → Configuration → Settings and select your +POS.
  2. +
  3. Ensure IoT Box is not checked.
  4. +
  5. Under the PyWebDriver section, enable Enable PyWebDriver.
  6. +
  7. Set the Proxy IP Address to the URL where PyWebDriver is +listening (default: https://127.0.0.1:8069).
  8. +
  9. Save.
  10. +
+ +
+Note: Enabling IoT Box will automatically disable +PyWebDriver, and enabling PyWebDriver will automatically disable IoT +Box. They cannot be active at the same time.
+
+
+

Usage

+

Once configured, open the POS session. The proxy connection is +established automatically on startup.

+
+

Status Indicator

+

The network status indicator in the POS navbar shows the proxy +connection state:

+
    +
  • Green sitemap icon — connected to PyWebDriver, printer ready.
  • +
  • Spinning icon — connecting.
  • +
  • Red sitemap icon — disconnected; check that PyWebDriver is +running and the IP address is correct.
  • +
+
+
+

Printing

+

Use the Print Receipt button as normal. Receipts are rendered as +JPEG images and sent to PyWebDriver via +/hw_proxy/default_printer_action.

+
+
+

Troubleshooting

+ ++++ + + + + + + + + + + + + + + + + +
SymptomLikely cause
Status indicator stays +disconnectedPyWebDriver not running, or +wrong IP/port in settings
“Printing failed — unknown +error”PyWebDriver reachable but +printer not responding; check +ESC/POS connection
Browser print dialog opens +insteaduse_pywebdriver not saved, +or session cache stale — reload +the POS page
+
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Open Source Integrators
  • +
+
+ +
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/pos project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+
+ + diff --git a/pos_pywebdriver/static/src/hardware_proxy_patch/hardware_proxy_patch.esm.js b/pos_pywebdriver/static/src/hardware_proxy_patch/hardware_proxy_patch.esm.js new file mode 100644 index 0000000000..235ea5e7cd --- /dev/null +++ b/pos_pywebdriver/static/src/hardware_proxy_patch/hardware_proxy_patch.esm.js @@ -0,0 +1,31 @@ +// Copyright 2026 Open Source Integrators +// License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). +// +// PyWebDriver mode (use_pywebdriver=True) is mutually exclusive with pos_iot. +// The server shim (_load_pos_data_read) sets is_posbox=True, proxy_ip, and +// iface_print_via_proxy=True so the base POS proxy flow connects automatically. +// +// This patch remaps drivers.escpos → drivers.printer so PyWebDriver's +// status_json response is recognised by the ProxyStatus indicator. +// Core HardwareProxy.connectToPrinter() already uses HWPrinter with the +// proxy URL, so no custom printer logic is needed. + +import {HardwareProxy} from "@point_of_sale/app/services/hardware_proxy_service"; +import {patch} from "@web/core/utils/patch"; + +patch(HardwareProxy.prototype, { + setConnectionInfo(info) { + // Remap drivers.escpos to drivers.printer so PyWebDriver's status_json + // response is recognised by the ProxyStatus indicator. + if (info.drivers?.escpos && !info.drivers?.printer) { + const modifiedInfo = Object.assign({}, info, { + drivers: Object.assign({}, info.drivers, { + printer: info.drivers.escpos, + }), + }); + super.setConnectionInfo(modifiedInfo); + } else { + super.setConnectionInfo(info); + } + }, +}); diff --git a/pos_pywebdriver/views/pos_config_views.xml b/pos_pywebdriver/views/pos_config_views.xml new file mode 100644 index 0000000000..d548943283 --- /dev/null +++ b/pos_pywebdriver/views/pos_config_views.xml @@ -0,0 +1,66 @@ + + + + pos.config.view.form.inherit.pos_pywebdriver + pos.config + + + + + +
+
+
+
+
+ +
+
+
+
+
+
+
+ + + res.config.settings.view.form.inherit.pos_pywebdriver + res.config.settings + + + + + + + +
+
+ +
+
+
+
+
+
+
+
+