Skip to content

Commit 4d18595

Browse files
committed
Merge PR #1367 into 16.0
Signed-off-by legalsylvain
2 parents 155ad2d + a3d24e0 commit 4d18595

18 files changed

Lines changed: 806 additions & 0 deletions

File tree

pos_hr_access_right/README.rst

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
====================================
2+
Point of Sale HR- Extra Access Right
3+
====================================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:0ba0fa710dd7a221861fae3bb525faefef43a0020ecad78dbae48fd01e8b780c
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github
20+
:target: https://github.com/OCA/pos/tree/16.0/pos_hr_access_right
21+
:alt: OCA/pos
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_hr_access_right
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/pos&target_branch=16.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
This module extends the pos_access_right functionality to enable support for multiple
32+
employees operating as cashiers within the same Point of Sale session.
33+
34+
**Table of contents**
35+
36+
.. contents::
37+
:local:
38+
39+
Configuration
40+
=============
41+
42+
Once installed, you must assign the appropriate access rights
43+
to the users linked to the respective employees.
44+
Employees who are not linked to a user will inherit the permissions
45+
of the currently logged-in user.
46+
47+
Usage
48+
=====
49+
50+
To use this functionality, simply enable the option for multiple employees
51+
per session and add the desired employees.
52+
53+
Bug Tracker
54+
===========
55+
56+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/pos/issues>`_.
57+
In case of trouble, please check there if your issue has already been reported.
58+
If you spotted it first, help us to smash it by providing a detailed and welcomed
59+
`feedback <https://github.com/OCA/pos/issues/new?body=module:%20pos_hr_access_right%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
60+
61+
Do not contact contributors directly about support or help with technical issues.
62+
63+
Credits
64+
=======
65+
66+
Authors
67+
~~~~~~~
68+
69+
* Binhex
70+
71+
Contributors
72+
~~~~~~~~~~~~
73+
74+
* `Binhex <https://www.binhex.cloud>`_:
75+
76+
* Adasat Torres de León <a.torres@binhex.cloud>
77+
78+
Maintainers
79+
~~~~~~~~~~~
80+
81+
This module is maintained by the OCA.
82+
83+
.. image:: https://odoo-community.org/logo.png
84+
:alt: Odoo Community Association
85+
:target: https://odoo-community.org
86+
87+
OCA, or the Odoo Community Association, is a nonprofit organization whose
88+
mission is to support the collaborative development of Odoo features and
89+
promote its widespread use.
90+
91+
.. |maintainer-adasatorres| image:: https://github.com/adasatorres.png?size=40px
92+
:target: https://github.com/adasatorres
93+
:alt: adasatorres
94+
95+
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
96+
97+
|maintainer-adasatorres|
98+
99+
This module is part of the `OCA/pos <https://github.com/OCA/pos/tree/16.0/pos_hr_access_right>`_ project on GitHub.
100+
101+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

pos_hr_access_right/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright 2025 Binhex - Adasat Torres de León
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3+
{
4+
"name": "Point of Sale HR- Extra Access Right",
5+
"version": "16.0.1.0.0",
6+
"category": "Point Of Sale",
7+
"summary": "Point of Sale HR - Extra Access Right for certain actions",
8+
"author": "Binhex ,Odoo Community Association (OCA)",
9+
"website": "https://github.com/OCA/pos",
10+
"license": "AGPL-3",
11+
"depends": ["pos_hr", "pos_access_right"],
12+
"data": [],
13+
"assets": {
14+
"point_of_sale.assets": [
15+
"pos_hr_access_right/static/src/js/*.js",
16+
]
17+
},
18+
"maintainers": ["adasatorres"],
19+
"installable": True,
20+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import pos_session
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright 2025 Binhex - Adasat Torres de León
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3+
from odoo import models
4+
5+
6+
class PosSession(models.Model):
7+
_inherit = "pos.session"
8+
9+
def _get_pos_ui_hr_employee(self, params):
10+
employee_vals = super()._get_pos_ui_hr_employee(params)
11+
for employee in employee_vals:
12+
user_id = employee.get("user_id", False)
13+
if not user_id:
14+
user_id = self.env.user.id
15+
user = self.env["res.users"].browse(user_id)
16+
groups = user.groups_id
17+
config = self.config_id
18+
employee.update(
19+
hasGroupPayment=config.group_payment_id in groups,
20+
hasGroupDiscount=config.group_discount_id in groups,
21+
hasGroupNegativeQty=config.group_negative_qty_id in groups,
22+
hasGroupPriceControl=config.group_change_unit_price_id in groups,
23+
hasGroupMultiOrder=config.group_multi_order_id in groups,
24+
hasGroupDeleteOrder=config.group_delete_order_id in groups,
25+
)
26+
return employee_vals
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Once installed, you must assign the appropriate access rights
2+
to the users linked to the respective employees.
3+
Employees who are not linked to a user will inherit the permissions
4+
of the currently logged-in user.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* `Binhex <https://www.binhex.cloud>`_:
2+
3+
* Adasat Torres de León <a.torres@binhex.cloud>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This module extends the pos_access_right functionality to enable support for multiple
2+
employees operating as cashiers within the same Point of Sale session.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
To use this functionality, simply enable the option for multiple employees
2+
per session and add the desired employees.
9.23 KB
Loading

0 commit comments

Comments
 (0)