-
-
Notifications
You must be signed in to change notification settings - Fork 680
[12.0][ADD] pos_self_service_base #655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| ============================ | ||
| Point Of Sale - Self-Service | ||
| ============================ | ||
|
|
||
| .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| !! This file is generated by oca-gen-addon-readme !! | ||
| !! changes will be overwritten. !! | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
|
||
| .. |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/licence-AGPL--3-blue.png | ||
| :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
| :alt: License: AGPL-3 | ||
| .. |badge3| image:: https://img.shields.io/badge/github-coopiteasy%2Faddons-lightgray.png?logo=github | ||
| :target: https://github.com/coopiteasy/addons/tree/12.0/pos_self_service_base | ||
| :alt: coopiteasy/addons | ||
|
|
||
| |badge1| |badge2| |badge3| | ||
|
|
||
| This is the base module for the implementation of POS as a self-service weighing station. | ||
| This module handles weighing/container taring and barcode formatting. | ||
| It is aimed to be used by several other modules: | ||
|
|
||
| * pos_self_service_print_zpl | ||
|
|
||
| **Table of contents** | ||
|
|
||
| .. contents:: | ||
| :local: | ||
|
|
||
| Configuration | ||
| ============= | ||
|
|
||
| Setup the self-service POS | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 1. Create a new POS | ||
| 2. Enable "Is Self-Service" | ||
| 3. Setup hardware proxy | ||
| * Enable electronic scale | ||
| 4. Enable barcode reader and its nomenclature | ||
|
|
||
| Usage | ||
| ===== | ||
|
|
||
| This module should be used from a computer accessible to customers. | ||
| In order to limit the risk of unfortunate/malicious actions, you should: | ||
|
|
||
| * **Use a dedicated odoo account with the least possible rights** | ||
| * Configure the web browser to be in kiosk mode (cf. "Launch Firefox" section) | ||
|
|
||
| Those measures aren't sufficient *per se*, but should lower the risk significantly. | ||
|
|
||
| Launch Firefox | ||
| ~~~~~~~~~~~~~~ | ||
|
|
||
| This self-service module can be used in kiosk mode. To launch Firefox in kiosk mode, run this command:: | ||
|
|
||
| firefox <url> -foreground --kiosk | ||
|
|
||
| Known issues / Roadmap | ||
| ====================== | ||
|
|
||
| * Label printing using web print | ||
|
|
||
| Bug Tracker | ||
| =========== | ||
|
|
||
| Bugs are tracked on `GitHub Issues <https://github.com/coopiteasy/addons/issues>`_. | ||
| In case of trouble, please check there if your issue has already been reported. | ||
| If you spotted it first, help us smashing it by providing a detailed and welcomed | ||
| `feedback <https://github.com/coopiteasy/addons/issues/new?body=module:%20pos_self_service_base%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
|
||
| Do not contact contributors directly about support or help with technical issues. | ||
|
|
||
| Credits | ||
| ======= | ||
|
|
||
| Authors | ||
| ~~~~~~~ | ||
|
|
||
| * Coop IT Easy SCRLfs | ||
|
|
||
| Contributors | ||
| ~~~~~~~~~~~~ | ||
|
|
||
| * `Coop IT Easy SCRLfs <https://coopiteasy.be>`_: | ||
| * Grégoire Leeuwerck <[email protected]> | ||
| * Vincent Van Rossem <[email protected]> | ||
| * `Le Nid <https://lenid.ch>`_: | ||
| * François Kawala | ||
| * `SPP <https://la-feve.ch>`_ | ||
| * Icons made by Freepik from flaticon.com | ||
|
|
||
| Maintainers | ||
| ~~~~~~~~~~~ | ||
|
|
||
| This module is part of the `coopiteasy/addons <https://github.com/coopiteasy/addons/tree/12.0/pos_self_service_base>`_ project on GitHub. | ||
|
|
||
| You are welcome to contribute. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| from . import models |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # Copyright 2021 - Today Coop IT Easy SCRLfs (<http://www.coopiteasy.be>) | ||
| # - Grégoire Leeuwerck <[email protected]> | ||
| # - Vincent Van Rossem <[email protected]> | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
| { | ||
| "name": "Point Of Sale - Self-Service", | ||
| "summary": "POS Self-Service Base Module", | ||
| "version": "12.0.1.0.0", | ||
| "category": "Point of Sale", | ||
| "author": "Coop IT Easy SCRLfs, Odoo Community Association (OCA)", | ||
| "website": "https://github.com/OCA/pos", | ||
| "license": "AGPL-3", | ||
| "depends": ["point_of_sale", "pos_tare"], | ||
| "data": ["views/templates.xml", "views/pos_config_view.xml"], | ||
| "qweb": ["static/src/xml/pos_self_service.xml"], | ||
| "installable": True, | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| from . import pos_config |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| from odoo import fields, models | ||
|
|
||
|
|
||
| class PosConfig(models.Model): | ||
| _inherit = "pos.config" | ||
|
|
||
| iface_self_service = fields.Boolean( | ||
| string="Is Self-Service", help="Use that POS as self-service point" | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| Setup the self-service POS | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpicking : I think the the 2 lines are unnecessary.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. points |
||
| 1. Create a new POS | ||
| 2. Enable "Is Self-Service" | ||
| 3. Setup hardware proxy | ||
| * Enable electronic scale | ||
| 4. Enable barcode reader and its nomenclature | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| * `Coop IT Easy SCRLfs <https://coopiteasy.be>`_: | ||
| * Grégoire Leeuwerck <[email protected]> | ||
| * Vincent Van Rossem <[email protected]> | ||
| * `Le Nid <https://lenid.ch>`_: | ||
| * François Kawala | ||
| * `SPP <https://la-feve.ch>`_ | ||
| * Icons made by Freepik from flaticon.com |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| This is the base module for the implementation of POS as a self-service weighing station. | ||
| This module handles weighing/container taring and barcode formatting. | ||
| It is aimed to be used by several other modules: | ||
|
|
||
| * pos_self_service_print_zpl |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| * Label printing using web print |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| This module should be used from a computer accessible to customers. | ||
| In order to limit the risk of unfortunate/malicious actions, you should: | ||
|
|
||
| * **Use a dedicated odoo account with the least possible rights** | ||
| * Configure the web browser to be in kiosk mode (cf. "Launch Firefox" section) | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe add : |
||
| Those measures aren't sufficient *per se*, but should lower the risk significantly. | ||
|
|
||
| Launch Firefox | ||
| ~~~~~~~~~~~~~~ | ||
|
|
||
| This self-service module can be used in kiosk mode. To launch Firefox in kiosk mode, run this command:: | ||
|
|
||
| firefox <url> -foreground --kiosk | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| upstream cups-reverse-proxy { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why this file is in the readme part ?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed, it should be in |
||
| server 127.0.0.1:631 weight=1 fail_timeout=60s; | ||
| } | ||
|
|
||
| server { | ||
| # server port and name | ||
| listen 8631; | ||
| listen [::]:8631; | ||
| server_name _; | ||
|
|
||
| # ssl log files | ||
| access_log /var/log/nginx/cups-access.log; | ||
| error_log /var/log/nginx/cups-error.log; | ||
|
|
||
|
|
||
| # increase proxy buffer to handle some Odoo web requests | ||
| proxy_buffers 16 64k; | ||
| proxy_buffer_size 128k; | ||
|
|
||
| location / { | ||
| proxy_pass http://cups-reverse-proxy; | ||
| proxy_set_header Host $host; | ||
| proxy_set_header X-Real-IP $remote_addr; | ||
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
| proxy_set_header X-Forwarded-Host $server_name; | ||
|
|
||
| add_header 'Access-Control-Allow-Origin' "http://localhost:8000" always; | ||
| add_header 'Access-Control-Allow-Credentials' * always; | ||
| add_header 'Access-Control-Allow-Methods' * always; | ||
| add_header 'Access-Control-Allow-Headers' * always; | ||
| # required to be able to read Authorization header in frontend | ||
| add_header 'Access-Control-Expose-Headers' * always; | ||
|
|
||
| if ($request_method = 'OPTIONS') { | ||
| # Tell client that this pre-flight info is valid for 20 days | ||
| add_header 'Access-Control-Max-Age' 1728000; | ||
| add_header 'Content-Type' 'text/plain charset=UTF-8'; | ||
| add_header 'Content-Length' 0; | ||
| add_header 'Access-Control-Allow-Origin' "http://localhost:8000" always; | ||
| add_header 'Access-Control-Allow-Credentials' * always; | ||
| add_header 'Access-Control-Allow-Methods' * always; | ||
| add_header 'Access-Control-Allow-Headers' * always; | ||
| # required to be able to read Authorization header in frontend | ||
| add_header 'Access-Control-Expose-Headers' * always; | ||
|
|
||
| return 204; | ||
| } | ||
|
|
||
| # by default, do not forward anything | ||
| proxy_redirect off; | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is foreground ?
I tested without, and it is launching in kiosk mode in the same way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-foregroundused to "Make this instance the active application.". I think it is now deprecated and will be removed fromREADME