Skip to content

Commit 714f19f

Browse files
Sayaka-qrtlSayaka Yamada
andauthored
[5862][ADD] base_model_restrict_update (#51)
Co-authored-by: Sayaka Yamada <[email protected]>
1 parent a72579f commit 714f19f

26 files changed

+1559
-0
lines changed
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
.. image:: https://odoo-community.org/readme-banner-image
2+
:target: https://odoo-community.org/get-involved?utm_source=readme
3+
:alt: Odoo Community Association
4+
5+
=====================
6+
Update Restrict Model
7+
=====================
8+
9+
..
10+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
11+
!! This file is generated by oca-gen-addon-readme !!
12+
!! changes will be overwritten. !!
13+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
14+
!! source digest: sha256:a0a6bc8d798dea0412aeb5e7c9f5fe8f7aec4d6d0e40c7e0d2c19ffc07bbb2cb
15+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16+
17+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
18+
:target: https://odoo-community.org/page/development-status
19+
:alt: Beta
20+
.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png
21+
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
22+
:alt: License: LGPL-3
23+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github
24+
:target: https://github.com/OCA/server-tools/tree/18.0/base_model_restrict_update
25+
:alt: OCA/server-tools
26+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
27+
:target: https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-base_model_restrict_update
28+
:alt: Translate me on Weblate
29+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
30+
:target: https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=18.0
31+
:alt: Try me on Runboat
32+
33+
|badge1| |badge2| |badge3| |badge4| |badge5|
34+
35+
This module adds the following features:
36+
37+
- The ability to limit the update permissions for a model to certain
38+
groups
39+
- The ability to revoke update permissions for specific users
40+
41+
**Table of contents**
42+
43+
.. contents::
44+
:local:
45+
46+
Configuration
47+
=============
48+
49+
When you want to limit the update permissions of a model to certain
50+
groups:
51+
52+
1. Go to *Settings > Techinical > Database Structure > Models*
53+
2. Open the form view of the model, and select **Update Restrict Model**
54+
3. Assign the groups that should be exempt from the restriction to
55+
**Update-allowed Groups**
56+
57+
When you want revoke update permissions for a specific user:
58+
59+
1. Go to *Settings > Users & Companies > Users*
60+
2. Open the user's form view and click the **Read-only** smart button
61+
3. In case you wish to exclude some models from being read-only, go to
62+
*Settings > General Settings* and update **Excluded Models from
63+
Read-only** under the Permissions section by listing the models
64+
separated by commas (e.g., sale.order,sale.order.line).
65+
66+
Bug Tracker
67+
===========
68+
69+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/issues>`_.
70+
In case of trouble, please check there if your issue has already been reported.
71+
If you spotted it first, help us to smash it by providing a detailed and welcomed
72+
`feedback <https://github.com/OCA/server-tools/issues/new?body=module:%20base_model_restrict_update%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
73+
74+
Do not contact contributors directly about support or help with technical issues.
75+
76+
Credits
77+
=======
78+
79+
Authors
80+
-------
81+
82+
* Quartile
83+
84+
Contributors
85+
------------
86+
87+
- `Quartile <https://www.quartile.co>`__:
88+
89+
- Yoshi Tashiro <[email protected]>
90+
91+
- Ecosoft
92+
93+
- Kitti U. <[email protected]>
94+
95+
Other credits
96+
-------------
97+
98+
- This module borrows the idea from 'Moises Lopez
99+
<https://odoo-community.org/groups/contributors-15/contributors-161807>'
100+
101+
Maintainers
102+
-----------
103+
104+
This module is maintained by the OCA.
105+
106+
.. image:: https://odoo-community.org/logo.png
107+
:alt: Odoo Community Association
108+
:target: https://odoo-community.org
109+
110+
OCA, or the Odoo Community Association, is a nonprofit organization whose
111+
mission is to support the collaborative development of Odoo features and
112+
promote its widespread use.
113+
114+
.. |maintainer-yostashiro| image:: https://github.com/yostashiro.png?size=40px
115+
:target: https://github.com/yostashiro
116+
:alt: yostashiro
117+
.. |maintainer-aungkokolin1997| image:: https://github.com/aungkokolin1997.png?size=40px
118+
:target: https://github.com/aungkokolin1997
119+
:alt: aungkokolin1997
120+
121+
Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:
122+
123+
|maintainer-yostashiro| |maintainer-aungkokolin1997|
124+
125+
This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/18.0/base_model_restrict_update>`_ project on GitHub.
126+
127+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright 2021-2024 Quartile (https://www.quartile.co)
2+
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
3+
{
4+
"name": "Update Restrict Model",
5+
"version": "18.0.1.0.0",
6+
"depends": ["base_setup"],
7+
"website": "https://github.com/OCA/server-tools",
8+
"author": "Odoo Community Association (OCA), Quartile",
9+
"category": "Others",
10+
"license": "LGPL-3",
11+
"data": [
12+
"data/config_parameter_data.xml",
13+
"views/ir_model_views.xml",
14+
"views/res_config_settings.xml",
15+
"views/res_users_views.xml",
16+
],
17+
"maintainers": ["yostashiro", "aungkokolin1997"],
18+
"installable": True,
19+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<odoo noupdate="1">
3+
<record id="excluded_models_from_readonly" model="ir.config_parameter">
4+
<field
5+
name="key"
6+
>base_model_restrict_update.excluded_models_from_readonly</field>
7+
<field name="value">bus.presence</field>
8+
</record>
9+
</odoo>
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * base_model_restrict_update
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 18.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"Last-Translator: \n"
10+
"Language-Team: \n"
11+
"MIME-Version: 1.0\n"
12+
"Content-Type: text/plain; charset=UTF-8\n"
13+
"Content-Transfer-Encoding: \n"
14+
"Plural-Forms: \n"
15+
16+
#. module: base_model_restrict_update
17+
#: model_terms:ir.ui.view,arch_db:base_model_restrict_update.view_users_form
18+
msgid "<span style=\"padding: 0 10px;\">Read-only</span>"
19+
msgstr ""
20+
21+
#. module: base_model_restrict_update
22+
#: model:ir.model,name:base_model_restrict_update.model_res_config_settings
23+
msgid "Config Settings"
24+
msgstr ""
25+
26+
#. module: base_model_restrict_update
27+
#: model_terms:ir.ui.view,arch_db:base_model_restrict_update.res_config_settings_view_form
28+
msgid "Excluded Models From Readonly"
29+
msgstr ""
30+
31+
#. module: base_model_restrict_update
32+
#: model:ir.model.fields,field_description:base_model_restrict_update.field_res_config_settings__excluded_models_from_readonly
33+
msgid "Excluded Models from Read-only"
34+
msgstr ""
35+
36+
#. module: base_model_restrict_update
37+
#: model:ir.model,name:base_model_restrict_update.model_ir_model_access
38+
msgid "Model Access"
39+
msgstr ""
40+
41+
#. module: base_model_restrict_update
42+
#: model:ir.model,name:base_model_restrict_update.model_ir_model
43+
msgid "Models"
44+
msgstr ""
45+
46+
#. module: base_model_restrict_update
47+
#: model:ir.model.fields,field_description:base_model_restrict_update.field_res_users__is_readonly_user
48+
msgid "Read-only User"
49+
msgstr ""
50+
51+
#. module: base_model_restrict_update
52+
#: model:ir.model.fields,help:base_model_restrict_update.field_res_users__is_readonly_user
53+
msgid ""
54+
"Select this option to prevent the user from updating any business records."
55+
msgstr ""
56+
57+
#. module: base_model_restrict_update
58+
#: model:ir.model.fields,field_description:base_model_restrict_update.field_ir_model__smart_search
59+
#: model:ir.model.fields,field_description:base_model_restrict_update.field_ir_model_access__smart_search
60+
#: model:ir.model.fields,field_description:base_model_restrict_update.field_res_config_settings__smart_search
61+
#: model:ir.model.fields,field_description:base_model_restrict_update.field_res_users__smart_search
62+
msgid "Smart Search"
63+
msgstr ""
64+
65+
#. module: base_model_restrict_update
66+
#: model:ir.model.fields,help:base_model_restrict_update.field_res_config_settings__excluded_models_from_readonly
67+
#: model_terms:ir.ui.view,arch_db:base_model_restrict_update.res_config_settings_view_form
68+
msgid ""
69+
"Specified models, separated by commas, will be exempt from the read-only "
70+
"restriction for read-only users."
71+
msgstr ""
72+
73+
#. module: base_model_restrict_update
74+
#: model:ir.model.fields,field_description:base_model_restrict_update.field_ir_model__restrict_update
75+
msgid "Update Restrict Model"
76+
msgstr ""
77+
78+
#. module: base_model_restrict_update
79+
#: model:ir.model.fields,field_description:base_model_restrict_update.field_ir_model__update_allowed_group_ids
80+
msgid "Update-Allowed Groups"
81+
msgstr ""
82+
83+
#. module: base_model_restrict_update
84+
#: model:ir.model,name:base_model_restrict_update.model_res_users
85+
msgid "User"
86+
msgstr ""
87+
88+
#. module: base_model_restrict_update
89+
#: model:ir.model.fields,help:base_model_restrict_update.field_ir_model__restrict_update
90+
msgid ""
91+
"When selected, the model is restricted to read-only unless the user belongs "
92+
"to an Update-Allowed Group."
93+
msgstr ""
94+
95+
#. module: base_model_restrict_update
96+
#. odoo-python
97+
#: code:addons/base_model_restrict_update/models/ir_model_access.py:0
98+
msgid "You are only allowed to read this record. (%(model)s - %(mode)s)"
99+
msgstr ""
100+
101+
#. module: base_model_restrict_update
102+
#. odoo-python
103+
#: code:addons/base_model_restrict_update/models/res_users.py:0
104+
msgid "You cannot make the admin user read-only."
105+
msgstr ""

0 commit comments

Comments
 (0)