Maintainers
+Maintainers
This module is part of the it-projects-llc/pos-addons project on GitHub.
You are welcome to contribute.
diff --git a/pos_esign_request/README.rst b/pos_esign_request/README.rst index d5837bb..8ac1e10 100644 --- a/pos_esign_request/README.rst +++ b/pos_esign_request/README.rst @@ -53,7 +53,8 @@ You need two devices: one for POS, another one for taking signs - Open E-Sign Kiosk on the second device - Open menu ``[[ Point of Sale ]] >> Dashboard`` - - Click ``E-Sign`` on the same POS as opened on the first device + - Click three dots on the same POS as opened on the first device + - Click ``E-Sign`` - On the first device click ``Customer`` button @@ -70,6 +71,13 @@ You need two devices: one for POS, another one for taking signs - On the first device for the customer in the **E-Sign** column ✔ sign appears +Known issues / Roadmap +====================== + +Current implementation technically depends on ``pos_self_order`` module. +Meanwhile no functional feature are used, only technical feature of self +order screen. + Bug Tracker =========== diff --git a/pos_esign_request/__manifest__.py b/pos_esign_request/__manifest__.py index 6e9a3ad..fb69a15 100644 --- a/pos_esign_request/__manifest__.py +++ b/pos_esign_request/__manifest__.py @@ -25,9 +25,8 @@ ], }, "data": [ - # "views/assets.xml", # TODO - # "views/pos_config_view.xml", # TODO "views/partner_views.xml", + "views/pos_config_views.xml", "views/res_config_settings_views.xml", ], "demo": [], diff --git a/pos_esign_request/controllers/main.py b/pos_esign_request/controllers/main.py index 7e86784..13eecb2 100644 --- a/pos_esign_request/controllers/main.py +++ b/pos_esign_request/controllers/main.py @@ -1,11 +1,16 @@ +from werkzeug.exceptions import Unauthorized + from odoo import http from odoo.http import request, route -from werkzeug.exceptions import Unauthorized class PosESignExtension(http.Controller): def _verify_pos_config(self, access_token): - pos_config_sudo = request.env['pos.config'].sudo().search([('access_token', '=', access_token)], limit=1) + pos_config_sudo = ( + request.env["pos.config"] + .sudo() + .search([("access_token", "=", access_token)], limit=1) + ) if not pos_config_sudo or not pos_config_sudo.has_active_session: raise Unauthorized("Invalid access token") return pos_config_sudo diff --git a/pos_esign_request/models/pos_config.py b/pos_esign_request/models/pos_config.py index c43efd3..21402a5 100644 --- a/pos_esign_request/models/pos_config.py +++ b/pos_esign_request/models/pos_config.py @@ -10,6 +10,19 @@ class PosConfig(models.Model): ) terms_to_sign = fields.Char(string="Terms & Conditions (ESign)") + def _get_esign_route(self): + self.ensure_one() + base_route = f"/pos-self/{self.id}/esign_kiosk" + return f"{base_route}?access_token={self.access_token}" + + def preview_esign_app(self): + self.ensure_one() + return { + "type": "ir.actions.act_url", + "url": self._get_esign_route(), + "target": "new", + } + @api.depends("ask_for_sign") @api.onchange("ask_for_sign") def _onchange_ask_for_sign(self): diff --git a/pos_esign_request/models/res_config_settings.py b/pos_esign_request/models/res_config_settings.py index 12c8d2d..2e23c95 100644 --- a/pos_esign_request/models/res_config_settings.py +++ b/pos_esign_request/models/res_config_settings.py @@ -1,4 +1,4 @@ -from odoo import fields, models +from odoo import api, fields, models class ResConfigSettings(models.TransientModel): @@ -13,3 +13,10 @@ class ResConfigSettings(models.TransientModel): pos_terms_to_sign = fields.Char( related="pos_config_id.terms_to_sign", readonly=False ) + + @api.onchange("pos_ask_for_sign", "pos_self_ordering_mode") + def _onchange_ask_for_sign(self): + if self.pos_ask_for_sign: + self.pos_self_ordering_mode = "mobile" + else: + self.pos_mandatory_ask_for_sign = False diff --git a/pos_esign_request/readme/ROADMAP.md b/pos_esign_request/readme/ROADMAP.md new file mode 100644 index 0000000..77d1ffc --- /dev/null +++ b/pos_esign_request/readme/ROADMAP.md @@ -0,0 +1,2 @@ +Current implementation technically depends on `pos_self_order` module. +Meanwhile no functional feature are used, only technical feature of self order screen. diff --git a/pos_esign_request/readme/USAGE.md b/pos_esign_request/readme/USAGE.md index e36eb52..6a0410a 100644 --- a/pos_esign_request/readme/USAGE.md +++ b/pos_esign_request/readme/USAGE.md @@ -4,7 +4,8 @@ You need two devices: one for POS, another one for taking signs * Open E-Sign Kiosk on the second device * Open menu `[[ Point of Sale ]] >> Dashboard` - * Click `E-Sign` on the same POS as opened on the first device + * Click three dots on the same POS as opened on the first device + * Click `E-Sign` * On the first device click `Customer` button * Select a Customer diff --git a/pos_esign_request/static/description/index.html b/pos_esign_request/static/description/index.html index 1227909..42b5c79 100644 --- a/pos_esign_request/static/description/index.html +++ b/pos_esign_request/static/description/index.html @@ -376,11 +376,12 @@
Current implementation technically depends on pos_self_order module. +Meanwhile no functional feature are used, only technical feature of self +order screen.
+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 @@ -428,15 +436,15 @@
Do not contact contributors directly about support or help with technical issues.
This module is part of the it-projects-llc/pos-addons project on GitHub.
You are welcome to contribute.