| @ -0,0 +1,50 @@ | |||||
|  | .. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg | ||||
|  |     :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html | ||||
|  |     :alt: License: AGPL-3 | ||||
|  | 
 | ||||
|  | POS User Restrict | ||||
|  | ================= | ||||
|  | This module helps you to restrict user access to pos and orders. | ||||
|  | 
 | ||||
|  | Configuration | ||||
|  | ============= | ||||
|  | * No additional configuration is needed | ||||
|  | 
 | ||||
|  | Company | ||||
|  | ------- | ||||
|  | * `Cybrosys Techno Solutions <https://cybrosys.com/>`__ | ||||
|  | 
 | ||||
|  | License | ||||
|  | ------- | ||||
|  | Affero General Public License v3.0 (AGPL v3) | ||||
|  | (https://www.gnu.org/licenses/agpl-3.0-standalone.html) | ||||
|  | 
 | ||||
|  | Credits | ||||
|  | ------- | ||||
|  | * Developers: (V15)Risha C.T, | ||||
|  |               (V16)Neenu Merlin Jose, | ||||
|  |               (V17)Busthana Shirin, | ||||
|  |               (V18)Bhagyadev KP | ||||
|  |   Contact: odoo@cybrosys.com | ||||
|  | 
 | ||||
|  | Contacts | ||||
|  | -------- | ||||
|  | * Mail Contact : odoo@cybrosys.com | ||||
|  | * Website : https://cybrosys.com | ||||
|  | 
 | ||||
|  | Bug Tracker | ||||
|  | ----------- | ||||
|  | Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. | ||||
|  | 
 | ||||
|  | Maintainer | ||||
|  | ========== | ||||
|  | .. image:: https://cybrosys.com/images/logo.png | ||||
|  |    :target: https://cybrosys.com | ||||
|  | 
 | ||||
|  | This module is maintained by Cybrosys Technologies. | ||||
|  | 
 | ||||
|  | For support and more information, please visit `Our Website <https://cybrosys.com/>`__ | ||||
|  | 
 | ||||
|  | Further information | ||||
|  | =================== | ||||
|  | HTML Description: `<static/description/index.html>`__ | ||||
| @ -0,0 +1,21 @@ | |||||
|  | # -*- coding: utf-8 -*- | ||||
|  | ################################################################################ | ||||
|  | # | ||||
|  | #    Cybrosys Technologies Pvt. Ltd. | ||||
|  | #    Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | ||||
|  | #    Author: Bhagyadev KP (odoo@cybrosys.com) | ||||
|  | # | ||||
|  | #    You can modify it under the terms of the GNU AFFERO | ||||
|  | #    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | ||||
|  | # | ||||
|  | #    This program is distributed in the hope that it will be useful, | ||||
|  | #    but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
|  | #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | ||||
|  | #    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | ||||
|  | # | ||||
|  | #    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | ||||
|  | #    (AGPL v3) along with this program. | ||||
|  | #    If not, see <https://www.gnu.org/licenses/>. | ||||
|  | # | ||||
|  | ################################################################################ | ||||
|  | from . import models | ||||
| @ -0,0 +1,44 @@ | |||||
|  | # -*- coding: utf-8 -*- | ||||
|  | ################################################################################ | ||||
|  | # | ||||
|  | #    Cybrosys Technologies Pvt. Ltd. | ||||
|  | # | ||||
|  | #    Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | ||||
|  | #    Author: Bhagyadev KP (odoo@cybrosys.com) | ||||
|  | # | ||||
|  | #    You can modify it under the terms of the GNU AFFERO | ||||
|  | #    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | ||||
|  | # | ||||
|  | #    This program is distributed in the hope that it will be useful, | ||||
|  | #    but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
|  | #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | ||||
|  | #    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | ||||
|  | # | ||||
|  | #    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | ||||
|  | #    (AGPL v3) along with this program. | ||||
|  | #    If not, see <https://www.gnu.org/licenses/>. | ||||
|  | # | ||||
|  | ################################################################################ | ||||
|  | { | ||||
|  |     'name': 'POS User Restrict', | ||||
|  |     'version': '18.0.1.0.0', | ||||
|  |     'category': 'Point of Sale', | ||||
|  |     'summary': """Restricts User access to pos and orders.""", | ||||
|  |     'description': """This module helps restrict user access to PoS and orders | ||||
|  |     while allowing them to manage multiple PoS locations as per their assigned | ||||
|  |     permissions.""", | ||||
|  |     'author': 'Cybrosys Techno Solutions', | ||||
|  |     'company': 'Cybrosys Techno Solutions', | ||||
|  |     'maintainer': 'Cybrosys Techno Solutions', | ||||
|  |     'website': "http://www.cybrosys.com", | ||||
|  |     'depends': ['point_of_sale'], | ||||
|  |     'data': [ | ||||
|  |         'security/pos_restrict_groups.xml', | ||||
|  |         'views/res_users_views.xml' | ||||
|  |     ], | ||||
|  |     'images': ['static/description/banner.jpg'], | ||||
|  |     'license': 'AGPL-3', | ||||
|  |     'installable': True, | ||||
|  |     'auto_install': False, | ||||
|  |     'application': False, | ||||
|  | } | ||||
| @ -0,0 +1,6 @@ | |||||
|  | ## Module <pos_restrict> | ||||
|  | 
 | ||||
|  | #### 19.02.2025 | ||||
|  | #### Version 18.0.1.0.0 | ||||
|  | ##### ADD | ||||
|  | - Initial commit for POS User Restrict | ||||
| @ -0,0 +1,23 @@ | |||||
|  | # -*- coding: utf-8 -*- | ||||
|  | ################################################################################ | ||||
|  | # | ||||
|  | #    Cybrosys Technologies Pvt. Ltd. | ||||
|  | # | ||||
|  | #    Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | ||||
|  | #    Author: Bhagyadev KP (odoo@cybrosys.com) | ||||
|  | # | ||||
|  | #    You can modify it under the terms of the GNU AFFERO | ||||
|  | #    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | ||||
|  | # | ||||
|  | #    This program is distributed in the hope that it will be useful, | ||||
|  | #    but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
|  | #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | ||||
|  | #    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | ||||
|  | # | ||||
|  | #    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | ||||
|  | #    (AGPL v3) along with this program. | ||||
|  | #    If not, see <https://www.gnu.org/licenses/>. | ||||
|  | # | ||||
|  | ################################################################################ | ||||
|  | from . import pos_config | ||||
|  | from . import res_users | ||||
| @ -0,0 +1,45 @@ | |||||
|  | # -*- coding: utf-8 -*- | ||||
|  | ################################################################################ | ||||
|  | # | ||||
|  | #    Cybrosys Technologies Pvt. Ltd. | ||||
|  | # | ||||
|  | #    Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | ||||
|  | #    Author: Bhagyadev KP (odoo@cybrosys.com) | ||||
|  | # | ||||
|  | #    You can modify it under the terms of the GNU AFFERO | ||||
|  | #    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | ||||
|  | # | ||||
|  | #    This program is distributed in the hope that it will be useful, | ||||
|  | #    but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
|  | #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | ||||
|  | #    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | ||||
|  | # | ||||
|  | #    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | ||||
|  | #    (AGPL v3) along with this program. | ||||
|  | #    If not, see <https://www.gnu.org/licenses/>. | ||||
|  | # | ||||
|  | ################################################################################ | ||||
|  | from odoo import fields, models | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | class PosConfig(models.Model): | ||||
|  |     """ Class added to Restrict the user for accessing pos """ | ||||
|  |     _inherit = 'pos.config' | ||||
|  | 
 | ||||
|  |     users_allowed = fields.Many2many( | ||||
|  |         comodel_name='res.users', | ||||
|  |         string='Users Allowed', | ||||
|  |         help='Which shows the specified pos for ' | ||||
|  |              'particular user', | ||||
|  |         compute='_compute_users_allowed' | ||||
|  |     ) | ||||
|  | 
 | ||||
|  |     def _compute_users_allowed(self): | ||||
|  |         # computes the allowed users in pos | ||||
|  |         for this in self: | ||||
|  |             # checks is show_users is ticked in user settings | ||||
|  |             if this.env.user.show_users: | ||||
|  |                 this.users_allowed = self.env['res.users'].search( | ||||
|  |                     [('allowed_pos', '=', this.id)]) | ||||
|  |             else: | ||||
|  |                 this.users_allowed = None | ||||
| @ -0,0 +1,35 @@ | |||||
|  | # -*- coding: utf-8 -*- | ||||
|  | ################################################################################ | ||||
|  | # | ||||
|  | #    Cybrosys Technologies Pvt. Ltd. | ||||
|  | # | ||||
|  | #    Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | ||||
|  | #    Author: Bhagyadev KP (odoo@cybrosys.com) | ||||
|  | # | ||||
|  | #    You can modify it under the terms of the GNU AFFERO | ||||
|  | #    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | ||||
|  | # | ||||
|  | #    This program is distributed in the hope that it will be useful, | ||||
|  | #    but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
|  | #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | ||||
|  | #    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | ||||
|  | # | ||||
|  | #    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | ||||
|  | #    (AGPL v3) along with this program. | ||||
|  | #    If not, see <https://www.gnu.org/licenses/>. | ||||
|  | # | ||||
|  | ################################################################################ | ||||
|  | from odoo import fields, models | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | class ResUsers(models.Model): | ||||
|  |     """ Class added for adding field to select the allowed pos for users. """ | ||||
|  |     _inherit = 'res.users' | ||||
|  | 
 | ||||
|  |     allowed_pos = fields.Many2many( | ||||
|  |         comodel_name='pos.config', | ||||
|  |         string='Allowed Pos', | ||||
|  |         help='Allowed Pos for this user' | ||||
|  |     ) | ||||
|  |     show_users = fields.Boolean(string="Show users of pos", default=True, | ||||
|  |                    help='Show users in dashboard for pos administrators only') | ||||
| @ -0,0 +1,31 @@ | |||||
|  | <?xml version="1.0" encoding="UTF-8"?> | ||||
|  | <odoo> | ||||
|  |     <!--    Set up the pos configuration    --> | ||||
|  |     <record id="restrict_user" model="ir.rule"> | ||||
|  |         <field name="name">Config User</field> | ||||
|  |         <field name="model_id" ref="point_of_sale.model_pos_config"/> | ||||
|  |         <field name="domain_force">[('id','in',user.allowed_pos.ids)]</field> | ||||
|  |         <field name="groups" eval="[(4,ref('point_of_sale.group_pos_user'))]"/> | ||||
|  |     </record> | ||||
|  |     <record id="restrict_manager" model="ir.rule"> | ||||
|  |         <field name="name">Config Manager</field> | ||||
|  |         <field name="model_id" ref="point_of_sale.model_pos_config"/> | ||||
|  |         <field name="domain_force">[]</field> | ||||
|  |         <field name="groups" | ||||
|  |                eval="[(4,ref('point_of_sale.group_pos_manager'))]"/> | ||||
|  |     </record> | ||||
|  |     <record id="order_user" model="ir.rule"> | ||||
|  |         <field name="name">Orders User</field> | ||||
|  |         <field name="model_id" ref="point_of_sale.model_pos_order"/> | ||||
|  |         <field name="domain_force">[('config_id','in',user.allowed_pos.ids)] | ||||
|  |         </field> | ||||
|  |         <field name="groups" eval="[(4,ref('point_of_sale.group_pos_user'))]"/> | ||||
|  |     </record> | ||||
|  |     <record id="order_manager" model="ir.rule"> | ||||
|  |         <field name="name">Orders Manager</field> | ||||
|  |         <field name="model_id" ref="point_of_sale.model_pos_order"/> | ||||
|  |         <field name="domain_force">[]</field> | ||||
|  |         <field name="groups" | ||||
|  |                eval="[(4,ref('point_of_sale.group_pos_manager'))]"/> | ||||
|  |     </record> | ||||
|  | </odoo> | ||||
| After Width: | Height: | Size: 2.2 KiB | 
| After Width: | Height: | Size: 28 KiB | 
| After Width: | Height: | Size: 628 KiB | 
| After Width: | Height: | Size: 1.1 KiB | 
| After Width: | Height: | Size: 210 KiB | 
| After Width: | Height: | Size: 209 KiB | 
| After Width: | Height: | Size: 109 KiB | 
| After Width: | Height: | Size: 495 B | 
| After Width: | Height: | Size: 1.0 KiB | 
| After Width: | Height: | Size: 624 B | 
| After Width: | Height: | Size: 136 KiB | 
| After Width: | Height: | Size: 214 KiB | 
| After Width: | Height: | Size: 36 KiB | 
| After Width: | Height: | Size: 3.6 KiB | 
| After Width: | Height: | Size: 310 B | 
| After Width: | Height: | Size: 929 B | 
| After Width: | Height: | Size: 1.3 KiB | 
| After Width: | Height: | Size: 3.3 KiB | 
| After Width: | Height: | Size: 1.4 KiB | 
| After Width: | Height: | Size: 17 KiB | 
| After Width: | Height: | Size: 542 B | 
| After Width: | Height: | Size: 576 B | 
| After Width: | Height: | Size: 733 B | 
| After Width: | Height: | Size: 4.3 KiB | 
| After Width: | Height: | Size: 1.2 KiB | 
| After Width: | Height: | Size: 4.0 KiB | 
| After Width: | Height: | Size: 1.7 KiB | 
| After Width: | Height: | Size: 738 KiB | 
| After Width: | Height: | Size: 2.2 KiB | 
| After Width: | Height: | Size: 911 B | 
| After Width: | Height: | Size: 1.1 KiB | 
| After Width: | Height: | Size: 1.2 KiB | 
| After Width: | Height: | Size: 1.2 KiB | 
| After Width: | Height: | Size: 600 B | 
| After Width: | Height: | Size: 673 B | 
| After Width: | Height: | Size: 2.0 KiB | 
| After Width: | Height: | Size: 462 B | 
| After Width: | Height: | Size: 2.1 KiB | 
| After Width: | Height: | Size: 926 B | 
| After Width: | Height: | Size: 9.0 KiB | 
| After Width: | Height: | Size: 23 KiB | 
| After Width: | Height: | Size: 7.0 KiB | 
| After Width: | Height: | Size: 878 B | 
| After Width: | Height: | Size: 1.2 KiB | 
| After Width: | Height: | Size: 653 B | 
| After Width: | Height: | Size: 800 B | 
| After Width: | Height: | Size: 905 B | 
| After Width: | Height: | Size: 189 KiB | 
| After Width: | Height: | Size: 4.3 KiB | 
| After Width: | Height: | Size: 839 B | 
| After Width: | Height: | Size: 1.7 KiB | 
| After Width: | Height: | Size: 5.9 KiB | 
| After Width: | Height: | Size: 1.6 KiB | 
| After Width: | Height: | Size: 34 KiB | 
| After Width: | Height: | Size: 26 KiB | 
| After Width: | Height: | Size: 3.8 KiB | 
| After Width: | Height: | Size: 23 KiB | 
| After Width: | Height: | Size: 1.9 KiB | 
| After Width: | Height: | Size: 2.3 KiB | 
| After Width: | Height: | Size: 427 B | 
| After Width: | Height: | Size: 627 B | 
| After Width: | Height: | Size: 1.1 KiB | 
| After Width: | Height: | Size: 1.2 KiB | 
| After Width: | Height: | Size: 988 B | 
| After Width: | Height: | Size: 3.7 KiB | 
| After Width: | Height: | Size: 5.0 KiB | 
| After Width: | Height: | Size: 875 B | 
| After Width: | Height: | Size: 1.2 KiB | 
| After Width: | Height: | Size: 86 KiB | 
| After Width: | Height: | Size: 138 KiB | 
| After Width: | Height: | Size: 90 KiB | 
| After Width: | Height: | Size: 703 KiB | 
| After Width: | Height: | Size: 144 KiB | 
| After Width: | Height: | Size: 724 KiB | 
| After Width: | Height: | Size: 90 KiB | 
| After Width: | Height: | Size: 69 KiB | 
| After Width: | Height: | Size: 20 KiB | 
| After Width: | Height: | Size: 79 KiB | 
| After Width: | Height: | Size: 38 KiB | 
| After Width: | Height: | Size: 174 KiB | 
| After Width: | Height: | Size: 880 KiB | 
| After Width: | Height: | Size: 710 KiB | 
| After Width: | Height: | Size: 44 KiB | 
| @ -0,0 +1,33 @@ | |||||
|  | <?xml version="1.0" encoding="UTF-8"?> | ||||
|  | <odoo> | ||||
|  |     <!--    Inherit User Model to add the allowed pos for particular user--> | ||||
|  |     <record id="view_users_form" model="ir.ui.view"> | ||||
|  |         <field name="name">res.users.view.form.inherit.pos.restrict</field> | ||||
|  |         <field name="model">res.users</field> | ||||
|  |         <field name="inherit_id" ref="base.view_users_form"/> | ||||
|  |         <field name="arch" type="xml"> | ||||
|  |             <xpath expr="//page[@name='access_rights']" position="after"> | ||||
|  |                 <page string="POS Users" groups="point_of_sale.group_pos_user"> | ||||
|  |                     <group> | ||||
|  |                         <field name="allowed_pos" widget="many2many_tags"/> | ||||
|  |                         <field name="show_users" | ||||
|  |                                groups="point_of_sale.group_pos_manager"/> | ||||
|  |                     </group> | ||||
|  |                 </page> | ||||
|  |             </xpath> | ||||
|  |         </field> | ||||
|  |     </record> | ||||
|  |     <!-- Inherit configuration to add the pos access --> | ||||
|  |     <record id="view_pos_config_kanban" model="ir.ui.view"> | ||||
|  |         <field name="name">pos.config.view.kanban.inherit.pos.restrict</field> | ||||
|  |         <field name="model">pos.config</field> | ||||
|  |         <field name="inherit_id" ref="point_of_sale.view_pos_config_kanban"/> | ||||
|  |         <field name="arch" type="xml"> | ||||
|  |             <field name="name" position="after"> | ||||
|  |                 <field name="users_allowed"/> | ||||
|  |                 <field name="users_allowed" | ||||
|  |                        groups="point_of_sale.group_pos_manager"/> | ||||
|  |             </field> | ||||
|  |         </field> | ||||
|  |     </record> | ||||
|  | </odoo> | ||||