Skip to content

Commit

Permalink
Merge PR #31 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by LoisRForgeFlow
  • Loading branch information
OCA-git-bot committed Mar 25, 2024
2 parents 37447cd + a829156 commit 421dba8
Show file tree
Hide file tree
Showing 15 changed files with 621 additions and 1 deletion.
76 changes: 76 additions & 0 deletions repair_security/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
===============
Repair Security
===============

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:3fe02b72d8ecc5810af4047e8ca9ef267f1fac979fc3f20627e4ea7829b16065
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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-OCA%2Frepair-lightgray.png?logo=github
:target: https://github.com/OCA/repair/tree/15.0/repair_security
:alt: OCA/repair
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/repair-15-0/repair-15-0-repair_security
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/repair&target_branch=15.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module adds security groups fro the Repair App to make it more configurable and independent of Stock.

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/repair/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/OCA/repair/issues/new?body=module:%20repair_security%0Aversion:%2015.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
~~~~~~~

* ForgeFlow S.L.

Contributors
~~~~~~~~~~~~

* David Jiménez <[email protected]>

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/repair <https://github.com/OCA/repair/tree/15.0/repair_security>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions repair_security/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .hook import post_init_hook
19 changes: 19 additions & 0 deletions repair_security/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2020 ForgeFlow S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Repair Security",
"summary": "Create security groups for Repair",
"version": "16.0.1.0.0",
"category": "Manufacturing",
"website": "https://github.com/OCA/repair",
"author": "ForgeFlow S.L., Odoo Community Association (OCA)",
"license": "AGPL-3",
"installable": True,
"depends": ["repair"],
"data": [
"security/repair_security.xml",
"security/ir.model.access.csv",
"views/repair_views.xml",
],
"post_init_hook": "post_init_hook",
}
12 changes: 12 additions & 0 deletions repair_security/hook.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from odoo import SUPERUSER_ID
from odoo.api import Environment


def post_init_hook(cr, _):
env = Environment(cr, SUPERUSER_ID, {})
# Giving Repair Admin access to match the previous permissions.
env.ref("repair_security.group_repair_manager").write(
{
"users": [(6, 0, env.ref("stock.group_stock_user").users.ids)],
}
)
29 changes: 29 additions & 0 deletions repair_security/i18n/repair_security.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * repair_security
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: repair_security
#: model:res.groups,name:repair_security.group_repair_manager
msgid "Administrator"
msgstr ""

#. module: repair_security
#: model:ir.module.category,name:repair_security.module_category_repair
msgid "Repair"
msgstr ""

#. module: repair_security
#: model:res.groups,name:repair_security.group_repair_user
msgid "User"
msgstr ""
1 change: 1 addition & 0 deletions repair_security/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* David Jiménez <[email protected]>
1 change: 1 addition & 0 deletions repair_security/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module adds security groups fro the Repair App to make it more configurable and independent of Stock.
13 changes: 13 additions & 0 deletions repair_security/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_repair_fee_user,Repair Fee user,repair.model_repair_fee,repair_security.group_repair_user,1,0,0,0
access_repair_fee_manager,Repair Fee manager,repair.model_repair_fee,repair_security.group_repair_manager,1,1,1,1
access_repair_user,Repair user,repair.model_repair_order,repair_security.group_repair_user,1,1,0,0
access_repair_manager,Repair manager,repair.model_repair_order,repair_security.group_repair_manager,1,1,1,1
access_repair_tag_user,Repair Tags user,repair.model_repair_tags,repair_security.group_repair_user,1,0,0,0
access_repair_tag_manager,Repair Tags user,repair.model_repair_tags,repair_security.group_repair_manager,1,1,1,1
access_repair_line_user,repair.line user,repair.model_repair_line,repair_security.group_repair_user,1,1,0,0
access_repair_line_manager,repair.line user,repair.model_repair_line,repair_security.group_repair_manager,1,1,1,1
access_account_tax_user,account.tax,account.model_account_tax,repair_security.group_repair_user,1,0,0,0
access_account_tax_manager,account.tax,account.model_account_tax,repair_security.group_repair_manager,1,0,0,0
access_repair_order_make_invoice_manager,access.repair.order.make_invoice,repair.model_repair_order_make_invoice,repair_security.group_repair_manager,1,1,1,1
access_stock_warn_insufficient_qty_repair_manager,access.stock.warn.insufficient.qty.repair,repair.model_stock_warn_insufficient_qty_repair,repair_security.group_repair_manager,1,1,1,1
31 changes: 31 additions & 0 deletions repair_security/security/repair_security.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">

<function model="ir.model.access" name="write">
<value
eval="[ref('repair.access_repair_fee_user'), ref('repair.access_repair_user'), ref('repair.access_repair_tag_user'), ref('repair.access_repair_line_user'), ref('repair.access_account_tax_user'), ref('repair.access_repair_order_make_invoice'), ref('repair.access_stock_warn_insufficient_qty_repair')]"
/>
<value eval="{'active': False }" />
</function>

<record model="ir.module.category" id="module_category_repair">
<field name="name">Repair</field>
<field name="sequence">25</field>
</record>

<record id="group_repair_user" model="res.groups">
<field name="name">User</field>
<field name="category_id" ref="repair_security.module_category_repair" />
<field name="implied_ids" eval="[(4, ref('base.group_user'))]" />
</record>
<record id="group_repair_manager" model="res.groups">
<field name="name">Administrator</field>
<field name="category_id" ref="repair_security.module_category_repair" />
<field name="implied_ids" eval="[(4, ref('group_repair_user'))]" />
<field
name="users"
eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"
/>
</record>

</odoo>
Binary file added repair_security/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 421dba8

Please sign in to comment.