-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] pos_rfid: мигрированная версия приватного модуля
Co-authored-by: Ivan Yelizariev <[email protected]> Co-authored-by: Alexandr Kolusov <[email protected]> Co-authored-by: Artem Rafailov <[email protected]> Co-authored-by: Eugene Molotov <[email protected]>
- Loading branch information
1 parent
70d739b
commit d06f400
Showing
18 changed files
with
650 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
====================== | ||
RFID adapter for POSes | ||
====================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:82e8f0faf8fa78126dea845163c89a69a84ceb534bd749e3b299888bcfcfa196 | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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-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-it--projects--llc%2Fpos--addons-lightgray.png?logo=github | ||
:target: https://github.com/it-projects-llc/pos-addons/tree/17.0/pos_rfid | ||
:alt: it-projects-llc/pos-addons | ||
|
||
|badge1| |badge2| |badge3| | ||
|
||
Converts RFID scan result to a proper value. | ||
|
||
It's not possible to make similar module that depends on ``barcodes`` | ||
only, because in some cases there is no way to automatically detect | ||
shall code be translated or not. So in that cases we trigger several | ||
events: with original code and with translated ones. | ||
|
||
Adapters | ||
======== | ||
|
||
HEX to DEC | ||
---------- | ||
|
||
E.g. ``167610E5 >> 0376836325`` | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Configuration | ||
============= | ||
|
||
- Open "Point of Sale" app | ||
- Open "Configutration" -> "Settings" | ||
- Choose POS | ||
- Enable "HEX Barcode" option | ||
|
||
Usage | ||
===== | ||
|
||
- Open POS | ||
- Scan RFID | ||
- RESULT: POS reacts in the same way as if RFID was scanned via normal | ||
RFID reader | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/it-projects-llc/pos-addons/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 <https://github.com/it-projects-llc/pos-addons/issues/new?body=module:%20pos_rfid%0Aversion:%2017.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 | ||
------- | ||
|
||
* IT-Projects LLC | ||
|
||
Contributors | ||
------------ | ||
|
||
- Ivan Yelizariev (https://github.com/yelizariev) | ||
- Alexandr Kolusov (https://github.com/KolushovAlexandr) | ||
- Artem Rafailov (https://github.com/Ommo73) | ||
- Eugene Molotov (https://github.com/em230418) | ||
|
||
Maintainers | ||
----------- | ||
|
||
This module is part of the `it-projects-llc/pos-addons <https://github.com/it-projects-llc/pos-addons/tree/17.0/pos_rfid>`_ project on GitHub. | ||
|
||
You are welcome to contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import models | ||
from . import controllers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": """RFID adapter for POSes""", | ||
"summary": """Converts RFID scan result to a proper value""", | ||
"category": "Point of Sale", | ||
"version": "17.0.1.0.0", | ||
"author": "IT-Projects LLC", | ||
"support": "[email protected]", | ||
"website": "https://github.com/it-projects-llc/pos-addons", | ||
"license": "LGPL-3", | ||
"depends": [ | ||
"point_of_sale", | ||
], | ||
"assets": { | ||
"point_of_sale._assets_pos": [ | ||
"pos_rfid/static/src/**/*", | ||
], | ||
}, | ||
"data": [ | ||
"views/res_config_settings_views.xml", | ||
], | ||
"demo": [], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from odoo.http import request, route | ||
|
||
from odoo.addons.point_of_sale.controllers.main import PosController | ||
|
||
|
||
class PosControllerRFID(PosController): | ||
@route() | ||
def pos_web(self, config_id=False, **kw): | ||
res = super().pos_web(config_id, **kw) | ||
if not config_id: | ||
return res | ||
|
||
config = request.env["pos.config"].sudo().browse(int(config_id)) | ||
res.qcontext["session_info"]["pos_hex_barcode"] = config.hex_barcode | ||
return res |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def migrate(cr, installed_version): | ||
cr.execute("UPDATE pos_config SET hex_barcode = pos_rfid") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import pos_config | ||
from . import res_config_settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from odoo import fields, models | ||
|
||
|
||
class PosConfig(models.Model): | ||
_inherit = "pos.config" | ||
|
||
hex_barcode = fields.Boolean("HEX Barcode") | ||
pos_rfid = fields.Boolean(deprecated=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from odoo import fields, models | ||
|
||
|
||
class ResConfigSettings(models.TransientModel): | ||
_inherit = "res.config.settings" | ||
|
||
pos_hex_barcode = fields.Integer( | ||
related="pos_config_id.hex_barcode", | ||
readonly=False, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[build-system] | ||
requires = ["whool"] | ||
build-backend = "whool.buildapi" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- Open "Point of Sale" app | ||
- Open "Configutration" -> "Settings" | ||
- Choose POS | ||
- Enable "HEX Barcode" option |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- Ivan Yelizariev (https://github.com/yelizariev) | ||
- Alexandr Kolusov (https://github.com/KolushovAlexandr) | ||
- Artem Rafailov (https://github.com/Ommo73) | ||
- Eugene Molotov (https://github.com/em230418) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Converts RFID scan result to a proper value. | ||
|
||
It's not possible to make similar module that depends on `barcodes` only, because in some cases there is no way to automatically detect shall code be translated or not. | ||
So in that cases we trigger several events: with original code and with translated ones. | ||
|
||
Adapters | ||
======== | ||
|
||
HEX to DEC | ||
---------- | ||
|
||
E.g. `167610E5 >> 0376836325` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* Open POS | ||
* Scan RFID | ||
* RESULT: POS reacts in the same way as if RFID was scanned via normal RFID reader |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.