Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 123 additions & 0 deletions base_model_restrict_update/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=====================
Update Restrict Model
=====================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:6bbb5448419f00cd204c7c7fc2c5f82b561fac27bf5cca089f85a01b7eb90711
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/license-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-OCA%2Fserver--tools-lightgray.png?logo=github
:target: https://github.com/OCA/server-tools/tree/16.0/base_model_restrict_update
:alt: OCA/server-tools
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/server-tools-16-0/server-tools-16-0-base_model_restrict_update
: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/server-tools&target_branch=16.0
:alt: Try me on Runboat

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

This module adds the following features:

* The ability to limit the update permissions for a model to certain groups
* The ability to revoke update permissions for specific users

**Table of contents**

.. contents::
:local:

Configuration
=============

When you want to limit the update permissions of a model to certain groups:

#. Go to *Settings > Techinical > Database Structure > Models*
#. Open the form view of the model, and select **Update Restrict Model**
#. Assign the groups that should be exempt from the restriction to **Update-allowed Groups**


When you want revoke update permissions for a specific user:

#. Go to *Settings > Users & Companies > Users*
#. Open the user's form view and click the **Read-only** smart button
#. In case you wish to exclude some models from being read-only, go to *Settings >
General Settings* and update **Excluded Models from Read-only** under the Permissions
section by listing the models separated by commas (e.g., `sale.order,sale.order.line`).

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

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

* Quartile

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

* `Quartile <https://www.quartile.co>`__:

* Yoshi Tashiro <tashiro@quartile.co>

* Ecosoft

* Kitti U. <kittiu@ecosoft.co.th>

Other credits
~~~~~~~~~~~~~

* This module borrows the idea from 'Moises Lopez <https://odoo-community.org/groups/contributors-15/contributors-161807>'

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.

.. |maintainer-yostashiro| image:: https://github.com/yostashiro.png?size=40px
:target: https://github.com/yostashiro
:alt: yostashiro
.. |maintainer-aungkokolin1997| image:: https://github.com/aungkokolin1997.png?size=40px
:target: https://github.com/aungkokolin1997
:alt: aungkokolin1997

Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-yostashiro| |maintainer-aungkokolin1997|

This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/16.0/base_model_restrict_update>`_ 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 base_model_restrict_update/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
19 changes: 19 additions & 0 deletions base_model_restrict_update/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2021-2024 Quartile
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
{
"name": "Update Restrict Model",
"version": "16.0.1.0.0",
"depends": ["base_setup"],
"website": "https://github.com/OCA/server-tools",
"author": "Odoo Community Association (OCA), Quartile",
"category": "Others",
"license": "LGPL-3",
"data": [
"data/config_parameter_data.xml",
"views/ir_model_views.xml",
"views/res_config_settings.xml",
"views/res_users_views.xml",
],
"maintainers": ["yostashiro", "aungkokolin1997"],
"installable": True,
}
9 changes: 9 additions & 0 deletions base_model_restrict_update/data/config_parameter_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="excluded_models_from_readonly" model="ir.config_parameter">
<field
name="key"
>base_model_restrict_update.excluded_models_from_readonly</field>
<field name="value">bus.presence</field>
</record>
</odoo>
174 changes: 174 additions & 0 deletions base_model_restrict_update/i18n/base_model_restrict_update.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * base_model_restrict_update
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.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: base_model_restrict_update
#: model_terms:ir.ui.view,arch_db:base_model_restrict_update.view_users_form
msgid "<span style=\"padding: 0 10px;\">Read-only</span>"
msgstr ""

#. module: base_model_restrict_update
#: model:ir.model.fields,field_description:base_model_restrict_update.field_ir_model__changeset_change_ids
#: model:ir.model.fields,field_description:base_model_restrict_update.field_ir_model_access__changeset_change_ids
#: model:ir.model.fields,field_description:base_model_restrict_update.field_res_config_settings__changeset_change_ids
#: model:ir.model.fields,field_description:base_model_restrict_update.field_res_users__changeset_change_ids
msgid "Changeset Changes"
msgstr ""

#. module: base_model_restrict_update
#: model:ir.model.fields,field_description:base_model_restrict_update.field_ir_model__changeset_ids
#: model:ir.model.fields,field_description:base_model_restrict_update.field_ir_model_access__changeset_ids
#: model:ir.model.fields,field_description:base_model_restrict_update.field_res_config_settings__changeset_ids
#: model:ir.model.fields,field_description:base_model_restrict_update.field_res_users__changeset_ids
msgid "Changesets"
msgstr ""

#. module: base_model_restrict_update
#: model:ir.model,name:base_model_restrict_update.model_res_config_settings
msgid "Config Settings"
msgstr ""

#. module: base_model_restrict_update
#: model:ir.model.fields,field_description:base_model_restrict_update.field_ir_model__count_changesets
#: model:ir.model.fields,field_description:base_model_restrict_update.field_ir_model_access__count_changesets
#: model:ir.model.fields,field_description:base_model_restrict_update.field_res_config_settings__count_changesets
#: model:ir.model.fields,field_description:base_model_restrict_update.field_res_users__count_changesets
msgid "Count Changesets"
msgstr ""

#. module: base_model_restrict_update
#: model:ir.model.fields,field_description:base_model_restrict_update.field_ir_model__count_pending_changeset_changes
#: model:ir.model.fields,field_description:base_model_restrict_update.field_ir_model_access__count_pending_changeset_changes
#: model:ir.model.fields,field_description:base_model_restrict_update.field_res_config_settings__count_pending_changeset_changes
#: model:ir.model.fields,field_description:base_model_restrict_update.field_res_users__count_pending_changeset_changes
msgid "Count Pending Changeset Changes"
msgstr ""

#. module: base_model_restrict_update
#: model:ir.model.fields,field_description:base_model_restrict_update.field_ir_model__count_pending_changesets
#: model:ir.model.fields,field_description:base_model_restrict_update.field_ir_model_access__count_pending_changesets
#: model:ir.model.fields,field_description:base_model_restrict_update.field_res_config_settings__count_pending_changesets
#: model:ir.model.fields,field_description:base_model_restrict_update.field_res_users__count_pending_changesets
msgid "Count Pending Changesets"
msgstr ""

#. module: base_model_restrict_update
#: model:ir.model.fields,field_description:base_model_restrict_update.field_res_config_settings__excluded_models_from_readonly
msgid "Excluded Models from Read-only"
msgstr ""

#. module: base_model_restrict_update
#: model:ir.model,name:base_model_restrict_update.model_ir_model_access
msgid "Model Access"
msgstr ""

#. module: base_model_restrict_update
#: model:ir.model,name:base_model_restrict_update.model_ir_model
msgid "Models"
msgstr ""

#. module: base_model_restrict_update
#: model:ir.model.fields,field_description:base_model_restrict_update.field_res_users__is_readonly_user
msgid "Read-only User"
msgstr ""

#. module: base_model_restrict_update
#: model:ir.model.fields,help:base_model_restrict_update.field_res_users__is_readonly_user
msgid ""
"Select this option to prevent the user from updating any business records."
msgstr ""

#. module: base_model_restrict_update
#: model:ir.model.fields,field_description:base_model_restrict_update.field_ir_model__smart_search
#: model:ir.model.fields,field_description:base_model_restrict_update.field_ir_model_access__smart_search
#: model:ir.model.fields,field_description:base_model_restrict_update.field_res_config_settings__smart_search
#: model:ir.model.fields,field_description:base_model_restrict_update.field_res_users__smart_search
msgid "Smart Search"
msgstr ""

#. module: base_model_restrict_update
#: model:ir.model.fields,help:base_model_restrict_update.field_res_config_settings__excluded_models_from_readonly
#: model_terms:ir.ui.view,arch_db:base_model_restrict_update.res_config_settings_view_form
msgid ""
"Specified models, separated by commas, will be exempt from the read-only "
"restriction for read-only users."
msgstr ""

#. module: base_model_restrict_update
#: model:ir.model.fields,help:base_model_restrict_update.field_ir_model__count_pending_changeset_changes
#: model:ir.model.fields,help:base_model_restrict_update.field_ir_model_access__count_pending_changeset_changes
#: model:ir.model.fields,help:base_model_restrict_update.field_res_config_settings__count_pending_changeset_changes
#: model:ir.model.fields,help:base_model_restrict_update.field_res_users__count_pending_changeset_changes
msgid "The number of pending changes of this record"
msgstr ""

#. module: base_model_restrict_update
#: model:ir.model.fields,help:base_model_restrict_update.field_ir_model__count_pending_changesets
#: model:ir.model.fields,help:base_model_restrict_update.field_ir_model_access__count_pending_changesets
#: model:ir.model.fields,help:base_model_restrict_update.field_res_config_settings__count_pending_changesets
#: model:ir.model.fields,help:base_model_restrict_update.field_res_users__count_pending_changesets
msgid "The number of pending changesets of this record"
msgstr ""

#. module: base_model_restrict_update
#: model:ir.model.fields,help:base_model_restrict_update.field_ir_model__count_changesets
#: model:ir.model.fields,help:base_model_restrict_update.field_ir_model_access__count_changesets
#: model:ir.model.fields,help:base_model_restrict_update.field_res_config_settings__count_changesets
#: model:ir.model.fields,help:base_model_restrict_update.field_res_users__count_changesets
msgid "The overall number of changesets of this record"
msgstr ""

#. module: base_model_restrict_update
#: model:ir.model.fields,field_description:base_model_restrict_update.field_ir_model__restrict_update
msgid "Update Restrict Model"
msgstr ""

#. module: base_model_restrict_update
#: model:ir.model.fields,field_description:base_model_restrict_update.field_ir_model__update_allowed_group_ids
msgid "Update-Allowed Groups"
msgstr ""

#. module: base_model_restrict_update
#: model:ir.model,name:base_model_restrict_update.model_res_users
msgid "User"
msgstr ""

#. module: base_model_restrict_update
#: model:ir.model.fields,field_description:base_model_restrict_update.field_ir_model__user_can_see_changeset
#: model:ir.model.fields,field_description:base_model_restrict_update.field_ir_model_access__user_can_see_changeset
#: model:ir.model.fields,field_description:base_model_restrict_update.field_res_config_settings__user_can_see_changeset
#: model:ir.model.fields,field_description:base_model_restrict_update.field_res_users__user_can_see_changeset
msgid "User Can See Changeset"
msgstr ""

#. module: base_model_restrict_update
#: model:ir.model.fields,help:base_model_restrict_update.field_ir_model__restrict_update
msgid ""
"When selected, the model is restricted to read-only unless the user belongs "
"to an Update-Allowed Group."
msgstr ""

#. module: base_model_restrict_update
#. odoo-python
#: code:addons/base_model_restrict_update/models/ir_model_access.py:0
#, python-format
msgid "You are only allowed to read this record. (%(model)s - %(mode)s)"
msgstr ""

#. module: base_model_restrict_update
#. odoo-python
#: code:addons/base_model_restrict_update/models/res_users.py:0
#, python-format
msgid "You cannot make the admin user read-only."
msgstr ""
Loading
Loading