diff --git a/attachment_delete_restrict/README.rst b/attachment_delete_restrict/README.rst new file mode 100644 index 00000000000..275bc703a69 --- /dev/null +++ b/attachment_delete_restrict/README.rst @@ -0,0 +1,130 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +================================ +Restrict Deletion of Attachments +================================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:f29bf33d2719e11ecbc0e7a7341f424b412b08c775dd2d391818da5f939ff65d + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-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%2Fserver--tools-lightgray.png?logo=github + :target: https://github.com/OCA/server-tools/tree/19.0/attachment_delete_restrict + :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-19-0/server-tools-19-0-attachment_delete_restrict + :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=19.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module provides the ability to restrict the deletion of the +attachments at different levels. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +Select level: +------------- + +1. Go to *Settings > General Settings> Permission section*. +2. Choose the level of *Restrict Delete Attachment* for all models by + default or for models with "default" restriction level. + +Five levels: +------------ + +- Default : Use global configuration +- Owner : Owner and admins only +- Custom : Certain groups or users per related model. +- Owner + Custom : Owner, admins and Certain groups or users per + related model. +- None : all users can delete them + +Only Custom and Owner + Custom need specific configuration on models. + +For Custom and Owner + Custom levels: +------------------------------------- + +1. Go to *Settings > Technical > Database Structure > Models*. +2. Open a model for which attachment deletion should be restricted. +3. Select 'Restrict Attachment Deletion', and assign 'Attachment + Deletion Groups' and/or 'Attachment Deletion Users' as necessary (if + no assignment, no one can delete the attachments of this model). + +For assigning 'Attachment Deletion Groups'/'Attachment Deletion Users' +to the model, you can alternatively add the model in the 'Attachment +Deletion Models' tab in the respective group/user form. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Quartile +* Akretion + +Contributors +------------ + +- Yoshi Tashiro +- Kévin Roche +- Sébastien BEAU + +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-Kev-Roche| image:: https://github.com/Kev-Roche.png?size=40px + :target: https://github.com/Kev-Roche + :alt: Kev-Roche + +Current `maintainers `__: + +|maintainer-yostashiro| |maintainer-Kev-Roche| + +This module is part of the `OCA/server-tools `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/attachment_delete_restrict/__init__.py b/attachment_delete_restrict/__init__.py new file mode 100644 index 00000000000..0650744f6bc --- /dev/null +++ b/attachment_delete_restrict/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/attachment_delete_restrict/__manifest__.py b/attachment_delete_restrict/__manifest__.py new file mode 100644 index 00000000000..b8fd61df1fa --- /dev/null +++ b/attachment_delete_restrict/__manifest__.py @@ -0,0 +1,22 @@ +# Copyright 2021 Quartile (https://www.quartile.co) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Restrict Deletion of Attachments", + "version": "19.0.1.0.0", + "depends": [ + "base", + "base_setup", + ], + "website": "https://github.com/OCA/server-tools", + "author": "Quartile, Akretion, Odoo Community Association (OCA)", + "category": "Tools", + "license": "AGPL-3", + "maintainers": ["yostashiro", "Kev-Roche"], + "data": [ + "views/ir_model_views.xml", + "views/res_groups_views.xml", + "views/res_users_views.xml", + "views/res_config_setting_views.xml", + ], + "installable": True, +} diff --git a/attachment_delete_restrict/i18n/attachment_delete_restrict.pot b/attachment_delete_restrict/i18n/attachment_delete_restrict.pot new file mode 100644 index 00000000000..822e1b1c331 --- /dev/null +++ b/attachment_delete_restrict/i18n/attachment_delete_restrict.pot @@ -0,0 +1,272 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * attachment_delete_restrict +# +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: attachment_delete_restrict +#: model:ir.model,name:attachment_delete_restrict.model_res_groups +msgid "Access Groups" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model,name:attachment_delete_restrict.model_ir_attachment +msgid "Attachment" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__delete_attachment_group_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__global_delete_attachment_group_ids +msgid "Attachment Deletion Groups" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__delete_attachment_model_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__delete_attachment_model_ids +#: model_terms:ir.ui.view,arch_db:attachment_delete_restrict.view_groups_form +#: model_terms:ir.ui.view,arch_db:attachment_delete_restrict.view_users_form +msgid "Attachment Deletion Models" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__delete_attachment_user_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__global_delete_attachment_user_ids +msgid "Attachment Deletion Users" +msgstr "" + +#. module: attachment_delete_restrict +#: model_terms:ir.ui.view,arch_db:attachment_delete_restrict.res_config_settings_view_form +msgid "Authorized Groups:" +msgstr "" + +#. module: attachment_delete_restrict +#: model_terms:ir.ui.view,arch_db:attachment_delete_restrict.res_config_settings_view_form +msgid "Authorized Users:" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__changeset_change_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__changeset_change_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__changeset_change_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__changeset_change_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__changeset_change_ids +msgid "Changeset Changes" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__changeset_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__changeset_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__changeset_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__changeset_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__changeset_ids +msgid "Changesets" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model,name:attachment_delete_restrict.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__count_changesets +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__count_changesets +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__count_changesets +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__count_changesets +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__count_changesets +msgid "Count Changesets" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__count_pending_changeset_changes +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__count_pending_changeset_changes +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__count_pending_changeset_changes +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__count_pending_changeset_changes +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__count_pending_changeset_changes +msgid "Count Pending Changeset Changes" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__count_pending_changesets +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__count_pending_changesets +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__count_pending_changesets +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__count_pending_changesets +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__count_pending_changesets +msgid "Count Pending Changesets" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__ir_model__restrict_delete_attachment__custom +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__res_config_settings__global_restrict_delete_attachment__custom +msgid "Custom: For each model, selected groups and users can delete them" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_config_settings__global_restrict_delete_attachment +msgid "Define a default value for Attachments Deletion" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model,name:attachment_delete_restrict.model_ir_model +msgid "Models" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__ir_model__restrict_delete_attachment__none +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__res_config_settings__global_restrict_delete_attachment__none +msgid "No restriction: All users / groups can delete them" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__ir_model__restrict_delete_attachment__owner_custom +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__res_config_settings__global_restrict_delete_attachment__owner_custom +msgid "" +"Owner + Custom: Creator and admin can delete them + for each model, selected" +" groups and users can delete them" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__ir_model__restrict_delete_attachment__owner +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__res_config_settings__global_restrict_delete_attachment__owner +msgid "Owner: Only creator and admin can delete them" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__restrict_delete_attachment +msgid "Restrict Attachment Deletion" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__global_restrict_delete_attachment +msgid "Restrict Delete Attachments" +msgstr "" + +#. module: attachment_delete_restrict +#: model_terms:ir.ui.view,arch_db:attachment_delete_restrict.res_config_settings_view_form +msgid "Restrict Deletion on attachment" +msgstr "" + +#. module: attachment_delete_restrict +#: model_terms:ir.ui.view,arch_db:attachment_delete_restrict.res_config_settings_view_form +msgid "Select default level of delete restriction on attachments" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__smart_search +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__smart_search +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__smart_search +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__smart_search +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__smart_search +msgid "Smart Search" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_ir_attachment__count_pending_changeset_changes +#: model:ir.model.fields,help:attachment_delete_restrict.field_ir_model__count_pending_changeset_changes +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_config_settings__count_pending_changeset_changes +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_groups__count_pending_changeset_changes +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_users__count_pending_changeset_changes +msgid "The number of pending changes of this record" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_ir_attachment__count_pending_changesets +#: model:ir.model.fields,help:attachment_delete_restrict.field_ir_model__count_pending_changesets +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_config_settings__count_pending_changesets +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_groups__count_pending_changesets +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_users__count_pending_changesets +msgid "The number of pending changesets of this record" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_ir_attachment__count_changesets +#: model:ir.model.fields,help:attachment_delete_restrict.field_ir_model__count_changesets +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_config_settings__count_changesets +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_groups__count_changesets +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_users__count_changesets +msgid "The overall number of changesets of this record" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_users__delete_attachment_model_ids +msgid "" +"The user can delete the attachments related to the models assigned here. " +"Restrict Attachment Deletion must be'Custom' or 'Owner + Custom' for the " +"model to be selected here." +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_config_settings__global_delete_attachment_group_ids +msgid "The users in the groups selected here can delete all the attachments." +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_ir_model__delete_attachment_group_ids +msgid "" +"The users in the groups selected here can delete the attachments related to " +"this model." +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_groups__delete_attachment_model_ids +msgid "" +"The users of the group can delete the attachments related to the models " +"assigned here. Restrict Attachment Deletion must be'Custom' or 'Owner + " +"Custom' for the model to be selected here." +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_config_settings__global_delete_attachment_user_ids +msgid "The users selected here can delete all the attachments" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_ir_model__delete_attachment_user_ids +msgid "" +"The users selected here can delete the attachments related to this model." +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__ir_model__restrict_delete_attachment__default +msgid "Use global configuration" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model,name:attachment_delete_restrict.model_res_users +msgid "User" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__user_can_see_changeset +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__user_can_see_changeset +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__user_can_see_changeset +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__user_can_see_changeset +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__user_can_see_changeset +msgid "User Can See Changeset" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_ir_model__restrict_delete_attachment +msgid "" +"When selected, the deletion of the attachments related to this model is " +"restricted to certain users." +msgstr "" + +#. module: attachment_delete_restrict +#. odoo-python +#: code:addons/attachment_delete_restrict/models/ir_attachment.py:0 +#, python-format +msgid "" +"You are not allowed to delete this attachment.\n" +"\n" +"Users with the delete permission:\n" +"%s" +msgstr "" diff --git a/attachment_delete_restrict/i18n/es_AR.po b/attachment_delete_restrict/i18n/es_AR.po new file mode 100644 index 00000000000..350126ff174 --- /dev/null +++ b/attachment_delete_restrict/i18n/es_AR.po @@ -0,0 +1,290 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * attachment_delete_restrict +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2022-09-04 06:07+0000\n" +"Last-Translator: Ignacio Buioli \n" +"Language-Team: none\n" +"Language: es_AR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: attachment_delete_restrict +#: model:ir.model,name:attachment_delete_restrict.model_res_groups +msgid "Access Groups" +msgstr "Grupos de Acceso" + +#. module: attachment_delete_restrict +#: model:ir.model,name:attachment_delete_restrict.model_ir_attachment +msgid "Attachment" +msgstr "Adjunto" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__delete_attachment_group_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__global_delete_attachment_group_ids +msgid "Attachment Deletion Groups" +msgstr "Grupos de Eliminación de Adjuntos" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__delete_attachment_model_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__delete_attachment_model_ids +#: model_terms:ir.ui.view,arch_db:attachment_delete_restrict.view_groups_form +#: model_terms:ir.ui.view,arch_db:attachment_delete_restrict.view_users_form +msgid "Attachment Deletion Models" +msgstr "Modelo de Eliminación de Adjuntos" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__delete_attachment_user_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__global_delete_attachment_user_ids +msgid "Attachment Deletion Users" +msgstr "Usuarios de Eliminación de Adjuntos" + +#. module: attachment_delete_restrict +#: model_terms:ir.ui.view,arch_db:attachment_delete_restrict.res_config_settings_view_form +msgid "Authorized Groups:" +msgstr "Grupos Autorizados:" + +#. module: attachment_delete_restrict +#: model_terms:ir.ui.view,arch_db:attachment_delete_restrict.res_config_settings_view_form +msgid "Authorized Users:" +msgstr "Usuarios Autorizados:" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__changeset_change_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__changeset_change_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__changeset_change_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__changeset_change_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__changeset_change_ids +msgid "Changeset Changes" +msgstr "Cambios del Conjunto de Cambios" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__changeset_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__changeset_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__changeset_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__changeset_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__changeset_ids +msgid "Changesets" +msgstr "Conjunto de Cambios" + +#. module: attachment_delete_restrict +#: model:ir.model,name:attachment_delete_restrict.model_res_config_settings +msgid "Config Settings" +msgstr "Ajustes Configuración" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__count_pending_changeset_changes +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__count_pending_changeset_changes +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__count_pending_changeset_changes +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__count_pending_changeset_changes +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__count_pending_changeset_changes +msgid "Count Pending Changeset Changes" +msgstr "Cuenta de los Cambios Pendientes de los Conjuntos de Cambios" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__count_pending_changesets +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__count_pending_changesets +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__count_pending_changesets +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__count_pending_changesets +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__count_pending_changesets +msgid "Count Pending Changesets" +msgstr "Cuenta de los Conjuntos de Cambios Pendientes" + +#. module: attachment_delete_restrict +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__ir_model__restrict_delete_attachment__custom +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__res_config_settings__global_restrict_delete_attachment__custom +msgid "Custom: For each model, selected groups and users can delete them" +msgstr "" +"Personalizado: Para cada modelo, los grupos y usuarios seleccionados pueden " +"eliminarlos" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_config_settings__global_restrict_delete_attachment +msgid "Define a default value for Attachments Deletion" +msgstr "Define un valor preterminado para la Eliminación de Adjuntos" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__display_name +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__display_name +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__display_name +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__display_name +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__display_name +msgid "Display Name" +msgstr "Mostrar Nombre" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__id +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__id +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__id +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__id +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__id +msgid "ID" +msgstr "ID" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment____last_update +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model____last_update +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings____last_update +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups____last_update +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users____last_update +msgid "Last Modified on" +msgstr "Última modificación en" + +#. module: attachment_delete_restrict +#: model:ir.model,name:attachment_delete_restrict.model_ir_model +msgid "Models" +msgstr "Modelos" + +#. module: attachment_delete_restrict +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__ir_model__restrict_delete_attachment__none +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__res_config_settings__global_restrict_delete_attachment__none +msgid "No restriction: All users / groups can delete them" +msgstr "No hay resitricción: Todos los usuarios / grupos pueden eliminarlos" + +#. module: attachment_delete_restrict +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__ir_model__restrict_delete_attachment__owner_custom +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__res_config_settings__global_restrict_delete_attachment__owner_custom +msgid "" +"Owner + Custom: Creator and admin can delete them + for each model, selected" +" groups and users can delete them" +msgstr "" +"Propietario + Personalizado: El creador y administrador puede eliminarlos + " +"para cada modelo, los grupos y usuarios seleccionados pueden eliminarlos" + +#. module: attachment_delete_restrict +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__ir_model__restrict_delete_attachment__owner +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__res_config_settings__global_restrict_delete_attachment__owner +msgid "Owner: Only creator and admin can delete them" +msgstr "Propietario: Solo el creador y el administrador puede eliminarlos" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__restrict_delete_attachment +msgid "Restrict Attachment Deletion" +msgstr "Restringir Eliminación de Adjuntos" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__global_restrict_delete_attachment +msgid "Restrict Delete Attachments" +msgstr "Restringir Eliminar Adjuntos" + +#. module: attachment_delete_restrict +#: model_terms:ir.ui.view,arch_db:attachment_delete_restrict.res_config_settings_view_form +msgid "Restrict Deletion on attachment" +msgstr "Restringir la Eliminación en adjunto" + +#. module: attachment_delete_restrict +#: model_terms:ir.ui.view,arch_db:attachment_delete_restrict.res_config_settings_view_form +msgid "Select default level of delete restriction on attachments" +msgstr "" +"Seleccione el nivel predeterminado de restricción de eliminación de archivos " +"adjuntos" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__smart_search +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__smart_search +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__smart_search +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__smart_search +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__smart_search +msgid "Smart Search" +msgstr "Búsqueda Inteligente" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_users__delete_attachment_model_ids +msgid "" +"The user can delete the attachments related to the models assigned here. In " +"general settings, 'Restrict Delete Attachment' must be set as 'custom' to " +"activate this setting." +msgstr "" +"El usuario puede eliminar los archivos adjuntos relacionados con los modelos " +"asignados aquí. En la configuración general, 'Restringir eliminar adjunto' " +"debe configurarse como 'Personalizado' para activar esta configuración." + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_config_settings__global_delete_attachment_group_ids +msgid "The users in the groups selected here can delete all the attachments." +msgstr "" +"Los usuarios en los grupos seleccionados acá pueden eliminar todos los " +"adjuntos." + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_ir_model__delete_attachment_group_ids +msgid "" +"The users in the groups selected here can delete the attachments related to " +"this model." +msgstr "" +"Los usuarios en los grupos seleccionados acá pueden eliminar los adjuntos " +"relacionados a este modelo." + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_groups__delete_attachment_model_ids +msgid "" +"The users of the group can delete the attachments related to the models " +"assigned here. In general settings, 'Restrict Delete Attachment' must be set" +" as 'custom' to activate this setting." +msgstr "" +"Los usuarios del grupo pueden eliminar los archivos adjuntos relacionados " +"con los modelos asignados acá. En la configuración general, 'Restringir " +"eliminar adjuntos' debe configurarse como 'Personalizado' para activar esta " +"configuración." + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_config_settings__global_delete_attachment_user_ids +msgid "The users selected here can delete all the attachments" +msgstr "Los usuarios seleccionados acá pueden eliminar todos los adjuntos" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_ir_model__delete_attachment_user_ids +msgid "" +"The users selected here can delete the attachments related to this model." +msgstr "" +"Los usuarios seleccionados acá pueden eliminar los adjuntos relacionados a " +"este modelo." + +#. module: attachment_delete_restrict +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__ir_model__restrict_delete_attachment__default +msgid "Use global configuration" +msgstr "Usar configuración global" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__user_can_see_changeset +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__user_can_see_changeset +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__user_can_see_changeset +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__user_can_see_changeset +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__user_can_see_changeset +msgid "User Can See Changeset" +msgstr "El Usuario Puede ver Conjuntos de Cambios" + +#. module: attachment_delete_restrict +#: model:ir.model,name:attachment_delete_restrict.model_res_users +msgid "Users" +msgstr "Usuarios" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_ir_model__restrict_delete_attachment +msgid "" +"When selected, the deletion of the attachments related to this model is " +"restricted to certain users." +msgstr "" +"Cuando se selecciona, la eliminación de los archivos adjuntos relacionados " +"con este modelo está restringida a ciertos usuarios." + +#. module: attachment_delete_restrict +#: code:addons/attachment_delete_restrict/models/ir_attachment.py:0 +#, python-format +msgid "" +"You are not allowed to delete this attachment.\n" +"\n" +"Users with the delete permission:\n" +"%s" +msgstr "" +"No tiene permitido eliminar este archivo adjunto\n" +"\n" +"Usuarios con permisos de eliminación:\n" +"%s" diff --git a/attachment_delete_restrict/i18n/fr.po b/attachment_delete_restrict/i18n/fr.po new file mode 100644 index 00000000000..ccaf58a6442 --- /dev/null +++ b/attachment_delete_restrict/i18n/fr.po @@ -0,0 +1,287 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * attachment_delete_restrict +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-07-11 14:14+0000\n" +"PO-Revision-Date: 2022-07-11 16:16+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: \n" +"X-Generator: Poedit 3.1.1\n" + +#. module: attachment_delete_restrict +#: model:ir.model,name:attachment_delete_restrict.model_res_groups +msgid "Access Groups" +msgstr "Groupes d'accès" + +#. module: attachment_delete_restrict +#: model:ir.model,name:attachment_delete_restrict.model_ir_attachment +msgid "Attachment" +msgstr "Pièce jointe" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__delete_attachment_group_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__global_delete_attachment_group_ids +msgid "Attachment Deletion Groups" +msgstr "Groupe avec droit de suppression de PJ" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__delete_attachment_model_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__delete_attachment_model_ids +#: model_terms:ir.ui.view,arch_db:attachment_delete_restrict.view_groups_form +#: model_terms:ir.ui.view,arch_db:attachment_delete_restrict.view_users_form +msgid "Attachment Deletion Models" +msgstr "Modèle avec restrictions de suppression de PJ" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__delete_attachment_user_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__global_delete_attachment_user_ids +msgid "Attachment Deletion Users" +msgstr "Utilisateurs avec droit de suppression de PJ" + +#. module: attachment_delete_restrict +#: model_terms:ir.ui.view,arch_db:attachment_delete_restrict.res_config_settings_view_form +msgid "Authorized Groups:" +msgstr "Groupes autorisés:" + +#. module: attachment_delete_restrict +#: model_terms:ir.ui.view,arch_db:attachment_delete_restrict.res_config_settings_view_form +msgid "Authorized Users:" +msgstr "Utilisateurs autorisés:" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__changeset_change_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__changeset_change_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__changeset_change_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__changeset_change_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__changeset_change_ids +msgid "Changeset Changes" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__changeset_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__changeset_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__changeset_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__changeset_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__changeset_ids +msgid "Changesets" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model,name:attachment_delete_restrict.model_res_config_settings +msgid "Config Settings" +msgstr "Paramètres de config" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__count_pending_changeset_changes +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__count_pending_changeset_changes +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__count_pending_changeset_changes +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__count_pending_changeset_changes +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__count_pending_changeset_changes +msgid "Count Pending Changeset Changes" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__count_pending_changesets +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__count_pending_changesets +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__count_pending_changesets +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__count_pending_changesets +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__count_pending_changesets +msgid "Count Pending Changesets" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__ir_model__restrict_delete_attachment__custom +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__res_config_settings__global_restrict_delete_attachment__custom +msgid "Custom: For each model, selected groups and users can delete them" +msgstr "" +"Personnalisé: Pour chaque modèle, sélectionner les groupes et/ou " +"utilisateurs ayant le droit" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_config_settings__global_restrict_delete_attachment +msgid "Define a default value for Attachments Deletion" +msgstr "Définir une valeur par défaut pour la suppression des pièces jointes" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__display_name +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__display_name +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__display_name +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__display_name +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__display_name +msgid "Display Name" +msgstr "Nom affiché" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__id +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__id +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__id +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__id +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__id +msgid "ID" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment____last_update +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model____last_update +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings____last_update +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups____last_update +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users____last_update +msgid "Last Modified on" +msgstr "Dernière modification le" + +#. module: attachment_delete_restrict +#: model:ir.model,name:attachment_delete_restrict.model_ir_model +msgid "Models" +msgstr "Modèles" + +#. module: attachment_delete_restrict +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__ir_model__restrict_delete_attachment__none +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__res_config_settings__global_restrict_delete_attachment__none +msgid "No restriction: All users / groups can delete them" +msgstr "Aucune restrictions: Tous les utilisateurs / groupes peuvent supprimer" + +#. module: attachment_delete_restrict +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__ir_model__restrict_delete_attachment__owner_custom +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__res_config_settings__global_restrict_delete_attachment__owner_custom +msgid "" +"Owner + Custom: Creator and admin can delete them + for each model, selected " +"groups and users can delete them" +msgstr "" +"Propriétaire + Personnalisé : Le créateur et l'administrateur peuvent les " +"supprimer + pour chaque modèle, les groupes et utilisateurs sélectionnés " +"peuvent les supprimer" + +#. module: attachment_delete_restrict +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__ir_model__restrict_delete_attachment__owner +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__res_config_settings__global_restrict_delete_attachment__owner +msgid "Owner: Only creator and admin can delete them" +msgstr "" +"Propriétaire : Seuls le créateur et l'administrateur peuvent les supprimer" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__restrict_delete_attachment +msgid "Restrict Attachment Deletion" +msgstr "Suppression de PJs Limitée" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__global_restrict_delete_attachment +msgid "Restrict Delete Attachments" +msgstr "Suppression de PJs Limitée" + +#. module: attachment_delete_restrict +#: model_terms:ir.ui.view,arch_db:attachment_delete_restrict.res_config_settings_view_form +msgid "Restrict Deletion on attachment" +msgstr "Restreindre la suppression de PJs" + +#. module: attachment_delete_restrict +#: model_terms:ir.ui.view,arch_db:attachment_delete_restrict.res_config_settings_view_form +msgid "Select default level of delete restriction on attachments" +msgstr "Sélectionner le niveau de restriction sur les pièces jointes" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__smart_search +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__smart_search +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__smart_search +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__smart_search +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__smart_search +msgid "Smart Search" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_users__delete_attachment_model_ids +msgid "" +"The user can delete the attachments related to the models assigned here. In " +"general settings, 'Restrict Delete Attachment' must be set as 'custom' to " +"activate this setting." +msgstr "" +"L'utilisateur peut supprimer les pièces jointes reliées au modèle assigné " +"ici. Dans la configuration générale, \"Restreindre la suppression de PJs\" " +"doit être à \"Personnalisé\" pour que cela s'active." + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_config_settings__global_delete_attachment_group_ids +msgid "The users in the groups selected here can delete all the attachments." +msgstr "" +"Les utilisateurs de ce groupe peuvent supprimer toutes les pièces jointes." + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_ir_model__delete_attachment_group_ids +msgid "" +"The users in the groups selected here can delete the attachments related to " +"this model." +msgstr "" +"Les utilisateurs de ces groupes peuvent supprimer les pièces jointes de ce " +"modèle." + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_groups__delete_attachment_model_ids +msgid "" +"The users of the group can delete the attachments related to the models " +"assigned here. In general settings, 'Restrict Delete Attachment' must be set " +"as 'custom' to activate this setting." +msgstr "" +"Les utilisateurs de ce groupe peuvent supprimer les pièces jointes reliées " +"au modèle assigné ici. Dans la configuration générale, \"Restreindre la " +"suppression de PJs\" doit être à \"Personnalisé\" pour que cela s'active." + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_config_settings__global_delete_attachment_user_ids +msgid "The users selected here can delete all the attachments" +msgstr "Ces utilisateurs peuvent supprimer toutes les pièces jointes" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_ir_model__delete_attachment_user_ids +msgid "" +"The users selected here can delete the attachments related to this model." +msgstr "Ces utilisateurs peuvent supprimer les pièces jointes de ce modèle." + +#. module: attachment_delete_restrict +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__ir_model__restrict_delete_attachment__default +msgid "Use global configuration" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__user_can_see_changeset +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__user_can_see_changeset +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__user_can_see_changeset +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__user_can_see_changeset +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__user_can_see_changeset +msgid "User Can See Changeset" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model,name:attachment_delete_restrict.model_res_users +msgid "Users" +msgstr "Utilisateurs" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_ir_model__restrict_delete_attachment +msgid "" +"When selected, the deletion of the attachments related to this model is " +"restricted to certain users." +msgstr "" +"Une fois sélectionné, la suppression de pièces jointes de ce modèle est " +"restreinte à certains utilisateurs." + +#. module: attachment_delete_restrict +#: code:addons/attachment_delete_restrict/models/ir_attachment.py:0 +#, python-format +msgid "" +"You are not allowed to delete this attachment.\n" +"\n" +"Users with the delete permission:\n" +"%s" +msgstr "" +"Vous n'êtes pas autorisé à supprimer cette pièce jointe.\n" +"\n" +"Utilisateurs ayant la permission:\n" +"%s" diff --git a/attachment_delete_restrict/i18n/it.po b/attachment_delete_restrict/i18n/it.po new file mode 100644 index 00000000000..ebe248e04b4 --- /dev/null +++ b/attachment_delete_restrict/i18n/it.po @@ -0,0 +1,299 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * attachment_delete_restrict +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2025-06-04 16:26+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 5.10.4\n" + +#. module: attachment_delete_restrict +#: model:ir.model,name:attachment_delete_restrict.model_res_groups +msgid "Access Groups" +msgstr "Gruppi di accesso" + +#. module: attachment_delete_restrict +#: model:ir.model,name:attachment_delete_restrict.model_ir_attachment +msgid "Attachment" +msgstr "Allegato" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__delete_attachment_group_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__global_delete_attachment_group_ids +msgid "Attachment Deletion Groups" +msgstr "Gruppi cancellazione allegato" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__delete_attachment_model_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__delete_attachment_model_ids +#: model_terms:ir.ui.view,arch_db:attachment_delete_restrict.view_groups_form +#: model_terms:ir.ui.view,arch_db:attachment_delete_restrict.view_users_form +msgid "Attachment Deletion Models" +msgstr "Modelli cancellazione allegato" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__delete_attachment_user_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__global_delete_attachment_user_ids +msgid "Attachment Deletion Users" +msgstr "Utenti cancellazione allegato" + +#. module: attachment_delete_restrict +#: model_terms:ir.ui.view,arch_db:attachment_delete_restrict.res_config_settings_view_form +msgid "Authorized Groups:" +msgstr "Gruppi autorizzati:" + +#. module: attachment_delete_restrict +#: model_terms:ir.ui.view,arch_db:attachment_delete_restrict.res_config_settings_view_form +msgid "Authorized Users:" +msgstr "Utenti autorizzati:" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__changeset_change_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__changeset_change_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__changeset_change_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__changeset_change_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__changeset_change_ids +msgid "Changeset Changes" +msgstr "Modifiche dell'insieme di modifiche" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__changeset_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__changeset_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__changeset_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__changeset_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__changeset_ids +msgid "Changesets" +msgstr "Insiemi di modifiche" + +#. module: attachment_delete_restrict +#: model:ir.model,name:attachment_delete_restrict.model_res_config_settings +msgid "Config Settings" +msgstr "Impostazioni configurazione" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__count_changesets +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__count_changesets +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__count_changesets +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__count_changesets +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__count_changesets +msgid "Count Changesets" +msgstr "Conteggio insieme di modifiche" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__count_pending_changeset_changes +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__count_pending_changeset_changes +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__count_pending_changeset_changes +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__count_pending_changeset_changes +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__count_pending_changeset_changes +msgid "Count Pending Changeset Changes" +msgstr "Conteggio modifiche dell'insieme di modifiche in attesa" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__count_pending_changesets +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__count_pending_changesets +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__count_pending_changesets +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__count_pending_changesets +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__count_pending_changesets +msgid "Count Pending Changesets" +msgstr "Conteggio insieme di modifiche in attesa" + +#. module: attachment_delete_restrict +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__ir_model__restrict_delete_attachment__custom +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__res_config_settings__global_restrict_delete_attachment__custom +msgid "Custom: For each model, selected groups and users can delete them" +msgstr "" +"Personalizzato: per ogni modello, gruppi e utenti selezionati lo possono " +"cancellare" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_config_settings__global_restrict_delete_attachment +msgid "Define a default value for Attachments Deletion" +msgstr "Definire un valore predefinito per la cancellazione allegati" + +#. module: attachment_delete_restrict +#: model:ir.model,name:attachment_delete_restrict.model_ir_model +msgid "Models" +msgstr "Modelli" + +#. module: attachment_delete_restrict +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__ir_model__restrict_delete_attachment__none +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__res_config_settings__global_restrict_delete_attachment__none +msgid "No restriction: All users / groups can delete them" +msgstr "Nessuna restrizione: tutti gli utenti / gruppi li possono cancellare" + +#. module: attachment_delete_restrict +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__ir_model__restrict_delete_attachment__owner_custom +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__res_config_settings__global_restrict_delete_attachment__owner_custom +msgid "" +"Owner + Custom: Creator and admin can delete them + for each model, selected" +" groups and users can delete them" +msgstr "" +"Proprietario + personalizzato: il creatore e l'amministratore li possono " +"cancellare + per ogni modello, gruppi e utenti selezionati" + +#. module: attachment_delete_restrict +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__ir_model__restrict_delete_attachment__owner +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__res_config_settings__global_restrict_delete_attachment__owner +msgid "Owner: Only creator and admin can delete them" +msgstr "Proprietario: solo il creatore e l'amministratore li possono cancellare" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__restrict_delete_attachment +msgid "Restrict Attachment Deletion" +msgstr "Limita cancellazione allegato" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__global_restrict_delete_attachment +msgid "Restrict Delete Attachments" +msgstr "Limita cancellazione allegati" + +#. module: attachment_delete_restrict +#: model_terms:ir.ui.view,arch_db:attachment_delete_restrict.res_config_settings_view_form +msgid "Restrict Deletion on attachment" +msgstr "Limita la cancellazione sugli allegati" + +#. module: attachment_delete_restrict +#: model_terms:ir.ui.view,arch_db:attachment_delete_restrict.res_config_settings_view_form +msgid "Select default level of delete restriction on attachments" +msgstr "" +"Selezionare il livello predefinito della limitazione di cancellazione sugli " +"allegati" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__smart_search +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__smart_search +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__smart_search +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__smart_search +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__smart_search +msgid "Smart Search" +msgstr "Ricerca intelligente" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_ir_attachment__count_pending_changeset_changes +#: model:ir.model.fields,help:attachment_delete_restrict.field_ir_model__count_pending_changeset_changes +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_config_settings__count_pending_changeset_changes +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_groups__count_pending_changeset_changes +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_users__count_pending_changeset_changes +msgid "The number of pending changes of this record" +msgstr "Numero di modifiche di questo record in attesa" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_ir_attachment__count_pending_changesets +#: model:ir.model.fields,help:attachment_delete_restrict.field_ir_model__count_pending_changesets +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_config_settings__count_pending_changesets +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_groups__count_pending_changesets +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_users__count_pending_changesets +msgid "The number of pending changesets of this record" +msgstr "Numero di insiemi di modifiche in attesa di questo record" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_ir_attachment__count_changesets +#: model:ir.model.fields,help:attachment_delete_restrict.field_ir_model__count_changesets +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_config_settings__count_changesets +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_groups__count_changesets +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_users__count_changesets +msgid "The overall number of changesets of this record" +msgstr "Numero totale di insiemi di modifiche di questo record" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_users__delete_attachment_model_ids +msgid "" +"The user can delete the attachments related to the models assigned here. " +"Restrict Attachment Deletion must be'Custom' or 'Owner + Custom' for the " +"model to be selected here." +msgstr "" +"L'utente può eliminare gli allegati relativi ai modelli assegnati qui. " +"L'opzione \"Limita eliminazione allegati\" deve essere \"Personalizzata\" o " +"\"Proprietario + personalizzata\" affinché il modello venga selezionato qui." + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_config_settings__global_delete_attachment_group_ids +msgid "The users in the groups selected here can delete all the attachments." +msgstr "" +"Gli utenti nei gruppi selezionati qui possono eliminare tutti gli allegati." + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_ir_model__delete_attachment_group_ids +msgid "" +"The users in the groups selected here can delete the attachments related to " +"this model." +msgstr "" +"Gli utenti nei gruppi selezionati qui possono eliminare gli allegati " +"relativi a questo modello." + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_groups__delete_attachment_model_ids +msgid "" +"The users of the group can delete the attachments related to the models " +"assigned here. Restrict Attachment Deletion must be'Custom' or 'Owner + " +"Custom' for the model to be selected here." +msgstr "" +"Gli utenti del gruppo possono eliminare gli allegati relativi ai modelli " +"assegnati qui. L'opzione \"Limita eliminazione allegati\" deve essere " +"\"Personalizzata\" o \"Proprietario + personalizzata\" affinché il modello " +"venga selezionato qui." + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_config_settings__global_delete_attachment_user_ids +msgid "The users selected here can delete all the attachments" +msgstr "Gli utenti selezionati qui possono eliminare tutti gli allegati" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_ir_model__delete_attachment_user_ids +msgid "" +"The users selected here can delete the attachments related to this model." +msgstr "" +"Gli utenti selezionati qui possono eliminare gli allegati relativi a questo " +"modello." + +#. module: attachment_delete_restrict +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__ir_model__restrict_delete_attachment__default +msgid "Use global configuration" +msgstr "Usa configurazione globale" + +#. module: attachment_delete_restrict +#: model:ir.model,name:attachment_delete_restrict.model_res_users +msgid "User" +msgstr "Utente" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__user_can_see_changeset +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__user_can_see_changeset +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__user_can_see_changeset +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__user_can_see_changeset +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__user_can_see_changeset +msgid "User Can See Changeset" +msgstr "L'utente può vedere l'insieme delle modifiche" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_ir_model__restrict_delete_attachment +msgid "" +"When selected, the deletion of the attachments related to this model is " +"restricted to certain users." +msgstr "" +"Quando selezionata, la cancellazione degli allegati relativi a questo " +"modello è limitata ad alcuni utenti." + +#. module: attachment_delete_restrict +#. odoo-python +#: code:addons/attachment_delete_restrict/models/ir_attachment.py:0 +#, python-format +msgid "" +"You are not allowed to delete this attachment.\n" +"\n" +"Users with the delete permission:\n" +"%s" +msgstr "" +"Non si è autorizzati ad eliminare questo allegato.\n" +"\n" +"Utenti con permesso di cancellazione:\n" +"%s" diff --git a/attachment_delete_restrict/i18n/ja.po b/attachment_delete_restrict/i18n/ja.po new file mode 100644 index 00000000000..0dca63d19d8 --- /dev/null +++ b/attachment_delete_restrict/i18n/ja.po @@ -0,0 +1,288 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * attachment_delete_restrict +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-08-29 14:47+0000\n" +"PO-Revision-Date: 2021-08-29 14:47+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: attachment_delete_restrict +#: model:ir.model,name:attachment_delete_restrict.model_res_groups +msgid "Access Groups" +msgstr "アクセスグループ" + +#. module: attachment_delete_restrict +#: model:ir.model,name:attachment_delete_restrict.model_ir_attachment +msgid "Attachment" +msgstr "添付" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__delete_attachment_group_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__global_delete_attachment_group_ids +msgid "Attachment Deletion Groups" +msgstr "添付削除グループ" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__delete_attachment_model_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__delete_attachment_model_ids +#: model_terms:ir.ui.view,arch_db:attachment_delete_restrict.view_groups_form +#: model_terms:ir.ui.view,arch_db:attachment_delete_restrict.view_users_form +msgid "Attachment Deletion Models" +msgstr "添付削除モデル" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__delete_attachment_user_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__global_delete_attachment_user_ids +msgid "Attachment Deletion Users" +msgstr "添付削除ユーザ" + +#. module: attachment_delete_restrict +#: model_terms:ir.ui.view,arch_db:attachment_delete_restrict.res_config_settings_view_form +msgid "Authorized Groups:" +msgstr "" + +#. module: attachment_delete_restrict +#: model_terms:ir.ui.view,arch_db:attachment_delete_restrict.res_config_settings_view_form +msgid "Authorized Users:" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__changeset_change_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__changeset_change_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__changeset_change_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__changeset_change_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__changeset_change_ids +msgid "Changeset Changes" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__changeset_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__changeset_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__changeset_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__changeset_ids +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__changeset_ids +msgid "Changesets" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model,name:attachment_delete_restrict.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__count_pending_changeset_changes +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__count_pending_changeset_changes +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__count_pending_changeset_changes +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__count_pending_changeset_changes +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__count_pending_changeset_changes +msgid "Count Pending Changeset Changes" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__count_pending_changesets +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__count_pending_changesets +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__count_pending_changesets +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__count_pending_changesets +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__count_pending_changesets +msgid "Count Pending Changesets" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__ir_model__restrict_delete_attachment__custom +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__res_config_settings__global_restrict_delete_attachment__custom +msgid "Custom: For each model, selected groups and users can delete them" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_config_settings__global_restrict_delete_attachment +#, fuzzy +msgid "Define a default value for Attachments Deletion" +msgstr "添付削除を制限" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__display_name +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__display_name +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__display_name +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__display_name +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__display_name +msgid "Display Name" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__id +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__id +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__id +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__id +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__id +msgid "ID" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment____last_update +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model____last_update +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings____last_update +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups____last_update +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users____last_update +msgid "Last Modified on" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model,name:attachment_delete_restrict.model_ir_model +msgid "Models" +msgstr "モデル" + +#. module: attachment_delete_restrict +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__ir_model__restrict_delete_attachment__none +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__res_config_settings__global_restrict_delete_attachment__none +msgid "No restriction: All users / groups can delete them" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__ir_model__restrict_delete_attachment__owner_custom +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__res_config_settings__global_restrict_delete_attachment__owner_custom +msgid "" +"Owner + Custom: Creator and admin can delete them + for each model, selected " +"groups and users can delete them" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__ir_model__restrict_delete_attachment__owner +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__res_config_settings__global_restrict_delete_attachment__owner +msgid "Owner: Only creator and admin can delete them" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__restrict_delete_attachment +msgid "Restrict Attachment Deletion" +msgstr "添付削除を制限" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__global_restrict_delete_attachment +#, fuzzy +msgid "Restrict Delete Attachments" +msgstr "添付削除を制限" + +#. module: attachment_delete_restrict +#: model_terms:ir.ui.view,arch_db:attachment_delete_restrict.res_config_settings_view_form +#, fuzzy +msgid "Restrict Deletion on attachment" +msgstr "添付削除を制限" + +#. module: attachment_delete_restrict +#: model_terms:ir.ui.view,arch_db:attachment_delete_restrict.res_config_settings_view_form +msgid "Select default level of delete restriction on attachments" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__smart_search +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__smart_search +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__smart_search +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__smart_search +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__smart_search +msgid "Smart Search" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_users__delete_attachment_model_ids +msgid "" +"The user can delete the attachments related to the models assigned here. In " +"general settings, 'Restrict Delete Attachment' must be set as 'custom' to " +"activate this setting." +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_config_settings__global_delete_attachment_group_ids +#, fuzzy +msgid "The users in the groups selected here can delete all the attachments." +msgstr "" +"ここで選択されたグループのユーザはこのモデルに関連する添付を削除することがで" +"きます。" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_ir_model__delete_attachment_group_ids +msgid "" +"The users in the groups selected here can delete the attachments related to " +"this model." +msgstr "" +"ここで選択されたグループのユーザはこのモデルに関連する添付を削除することがで" +"きます。" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_groups__delete_attachment_model_ids +#, fuzzy +msgid "" +"The users of the group can delete the attachments related to the models " +"assigned here. In general settings, 'Restrict Delete Attachment' must be set " +"as 'custom' to activate this setting." +msgstr "" +"グループのユーザはここで割り当てられたモデルの添付を削除することができます。" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_res_config_settings__global_delete_attachment_user_ids +#, fuzzy +msgid "The users selected here can delete all the attachments" +msgstr "" +"ここで選択されたユーザはこのモデルに関連する添付を削除することができます。" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_ir_model__delete_attachment_user_ids +msgid "" +"The users selected here can delete the attachments related to this model." +msgstr "" +"ここで選択されたユーザはこのモデルに関連する添付を削除することができます。" + +#. module: attachment_delete_restrict +#: model:ir.model.fields.selection,name:attachment_delete_restrict.selection__ir_model__restrict_delete_attachment__default +msgid "Use global configuration" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_attachment__user_can_see_changeset +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_ir_model__user_can_see_changeset +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_config_settings__user_can_see_changeset +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_groups__user_can_see_changeset +#: model:ir.model.fields,field_description:attachment_delete_restrict.field_res_users__user_can_see_changeset +msgid "User Can See Changeset" +msgstr "" + +#. module: attachment_delete_restrict +#: model:ir.model,name:attachment_delete_restrict.model_res_users +msgid "Users" +msgstr "ユーザ" + +#. module: attachment_delete_restrict +#: model:ir.model.fields,help:attachment_delete_restrict.field_ir_model__restrict_delete_attachment +msgid "" +"When selected, the deletion of the attachments related to this model is " +"restricted to certain users." +msgstr "" +"選択された場合、このモデルに関連する添付の削除は許可されたユーザのみに制限さ" +"れます。" + +#. module: attachment_delete_restrict +#: code:addons/attachment_delete_restrict/models/ir_attachment.py:0 +#, python-format +msgid "" +"You are not allowed to delete this attachment.\n" +"\n" +"Users with the delete permission:\n" +"%s" +msgstr "" +"この添付の削除権限がありません。\n" +"\n" +"削除権限を持つユーザ:\n" +"%s" + +#~ msgid "" +#~ "The user can delete the attachments related to the models assigned here." +#~ msgstr "ユーザはここで割り当てられたモデルの添付を削除することができます。" diff --git a/attachment_delete_restrict/models/__init__.py b/attachment_delete_restrict/models/__init__.py new file mode 100644 index 00000000000..53b5a8681e4 --- /dev/null +++ b/attachment_delete_restrict/models/__init__.py @@ -0,0 +1,5 @@ +from . import ir_attachment +from . import ir_model +from . import res_groups +from . import res_users +from . import res_config diff --git a/attachment_delete_restrict/models/ir_attachment.py b/attachment_delete_restrict/models/ir_attachment.py new file mode 100644 index 00000000000..8c514b21676 --- /dev/null +++ b/attachment_delete_restrict/models/ir_attachment.py @@ -0,0 +1,82 @@ +# Copyright 2021 Quartile (https://www.quartile.co) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import SUPERUSER_ID, models +from odoo.exceptions import ValidationError + + +class IrAttachment(models.Model): + _inherit = "ir.attachment" + + def _check_delete_attachment(self, model=None): + if model: + restrict = model.restrict_delete_attachment + else: + restrict = ( + self.env["ir.config_parameter"] + .sudo() + .get_param( + "attachment_delete_restrict.global_restrict_delete_attachment" + ) + ) + if restrict == "owner": + self._check_owner_delete_attachment() + elif restrict == "custom": + self._check_custom_delete_attachment(model) + elif restrict == "owner_custom": + self._check_custom_delete_attachment(model, allow_owner_and_admin=True) + + def _raise_delete_attachment_error(self, allowed_users): + raise ValidationError( + self.env._( + "You are not allowed to delete this attachment.\n\nUsers with " + "the delete permission:\n%s" + ) + % ("\n".join(allowed_users.mapped("name")) or "None") + ) + + def _check_owner_delete_attachment(self): + if not ( + self.create_uid == self.env.user + or self.env.user.has_group("base.group_system") + ): + return self._raise_delete_attachment_error( + self.create_uid | self.env.ref("base.group_system").user_ids + ) + + def _check_custom_delete_attachment(self, model=None, allow_owner_and_admin=False): + if model: + groups = model.delete_attachment_group_ids + users = model.delete_attachment_user_ids + else: + groups = self.env[ + "res.config.settings" + ]._get_global_delete_attachment_groups() + users = self.env[ + "res.config.settings" + ]._get_global_delete_attachment_users() + if allow_owner_and_admin: + users += self.create_uid + groups += self.env.ref("base.group_system") + allowed_users = groups.user_ids | users + if self.env.user not in allowed_users: + return self._raise_delete_attachment_error(allowed_users) + + def unlink(self): + if self.env.uid == SUPERUSER_ID: + return super().unlink() + res_models = list(set(self.filtered("res_model").mapped("res_model"))) + if res_models: + models = self.env["ir.model"].sudo().search([("model", "in", res_models)]) + name2models = {m.model: m for m in models} + for rec in self: + if rec.res_model: + model = name2models[rec.res_model] + if ( + model.restrict_delete_attachment == "default" + or not model.restrict_delete_attachment + ): + rec.sudo()._check_delete_attachment() + else: + rec.sudo()._check_delete_attachment(model) + return super().unlink() diff --git a/attachment_delete_restrict/models/ir_model.py b/attachment_delete_restrict/models/ir_model.py new file mode 100644 index 00000000000..de30a1d4594 --- /dev/null +++ b/attachment_delete_restrict/models/ir_model.py @@ -0,0 +1,50 @@ +# Copyright 2021 Quartile (https://www.quartile.co) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + +RESTRICT_DELETE_ATTACH = [ + ("default", "Use global configuration"), + ("owner", "Owner: Only creator and admin can delete them"), + ("custom", "Custom: For each model, selected groups and users can delete them"), + ( + "owner_custom", + "Owner + Custom: Creator and admin can delete them + for " + "each model, selected groups and users can delete them", + ), + ("none", "No restriction: All users / groups can delete them"), +] + + +class IrModel(models.Model): + _inherit = "ir.model" + + restrict_delete_attachment = fields.Selection( + selection=RESTRICT_DELETE_ATTACH, + string="Restrict Attachment Deletion", + help="When selected, the deletion of the attachments related to this model is " + "restricted to certain users.", + default="default", + ) + + delete_attachment_group_ids = fields.Many2many( + "res.groups", + string="Attachment Deletion Groups", + relation="delete_attachment_group_rel", + help="The users in the groups selected here can delete the attachments related " + "to this model.", + ) + + delete_attachment_user_ids = fields.Many2many( + "res.users", + string="Attachment Deletion Users", + relation="delete_attachment_user_rel", + help="The users selected here can delete the attachments related to this " + "model.", + ) + + @api.onchange("restrict_delete_attachment") + def _onchange_restrict_delete_attachment(self): + if self.restrict_delete_attachment not in ["custom", "owner_custom"]: + self.delete_attachment_group_ids = False + self.delete_attachment_user_ids = False diff --git a/attachment_delete_restrict/models/res_config.py b/attachment_delete_restrict/models/res_config.py new file mode 100644 index 00000000000..8c2477c9f75 --- /dev/null +++ b/attachment_delete_restrict/models/res_config.py @@ -0,0 +1,88 @@ +# Copyright (C) 2022 Akretion (). +# @author Kévin Roche +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from ast import literal_eval + +from odoo import api, fields, models + +from .ir_model import RESTRICT_DELETE_ATTACH + + +class ResConfigSettings(models.TransientModel): + _inherit = "res.config.settings" + + global_restrict_delete_attachment = fields.Selection( + selection=RESTRICT_DELETE_ATTACH[1:], + config_parameter="attachment_delete_restrict.global_restrict_delete_attachment", + readonly=False, + required=True, + default="none", + string="Restrict Delete Attachments", + help="Define a default value for Attachments Deletion", + ) + + global_delete_attachment_group_ids = fields.Many2many( + "res.groups", + string="Attachment Deletion Groups", + help="The users in the groups selected here can delete all the attachments.", + readonly=False, + compute_sudo=True, + compute="_compute_global_delete_attachment_group_ids", + inverse="_inverse_global_delete_attachment_group_ids", + ) + global_delete_attachment_user_ids = fields.Many2many( + "res.users", + string="Attachment Deletion Users", + help="The users selected here can delete all the attachments", + readonly=False, + compute_sudo=True, + compute="_compute_global_delete_attachment_user_ids", + inverse="_inverse_global_delete_attachment_user_ids", + ) + + def _get_global_delete_attachment_groups(self): + str_group_ids = self.env["ir.config_parameter"].get_param( + "attachment_delete_restrict.global_delete_attachment_group_ids" + ) + groups_ids = literal_eval(str_group_ids or "[]") + return self.env["res.groups"].search([("id", "in", groups_ids)]) + + @api.depends("global_restrict_delete_attachment") + def _compute_global_delete_attachment_group_ids(self): + groups = self._get_global_delete_attachment_groups() + for setting in self: + if "custom" in setting.global_restrict_delete_attachment: + setting.global_delete_attachment_group_ids = groups + else: + setting.global_delete_attachment_group_ids = None + + def _inverse_global_delete_attachment_group_ids(self): + for setting in self: + self.env["ir.config_parameter"].set_param( + "attachment_delete_restrict.global_delete_attachment_group_ids", + str(setting.global_delete_attachment_group_ids.ids), + ) + + def _get_global_delete_attachment_users(self): + str_user_ids = self.env["ir.config_parameter"].get_param( + "attachment_delete_restrict.global_delete_attachment_user_ids" + ) + user_ids = literal_eval(str_user_ids or "[]") + return self.env["res.users"].search([("id", "in", user_ids)]) + + @api.depends("global_restrict_delete_attachment") + def _compute_global_delete_attachment_user_ids(self): + users = self._get_global_delete_attachment_users() + for setting in self: + if "custom" in setting.global_restrict_delete_attachment: + setting.global_delete_attachment_user_ids = users + else: + setting.global_delete_attachment_user_ids = None + + def _inverse_global_delete_attachment_user_ids(self): + for setting in self: + self.env["ir.config_parameter"].set_param( + "attachment_delete_restrict.global_delete_attachment_user_ids", + str(setting.global_delete_attachment_user_ids.ids), + ) diff --git a/attachment_delete_restrict/models/res_groups.py b/attachment_delete_restrict/models/res_groups.py new file mode 100644 index 00000000000..a7cf1ba33b4 --- /dev/null +++ b/attachment_delete_restrict/models/res_groups.py @@ -0,0 +1,17 @@ +# Copyright 2021 Quartile (https://www.quartile.co) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ResGroups(models.Model): + _inherit = "res.groups" + + delete_attachment_model_ids = fields.Many2many( + "ir.model", + relation="delete_attachment_group_rel", + string="Attachment Deletion Models", + help="The users of the group can delete the attachments related to " + "the models assigned here. Restrict Attachment Deletion must be" + "'Custom' or 'Owner + Custom' for the model to be selected here.", + ) diff --git a/attachment_delete_restrict/models/res_users.py b/attachment_delete_restrict/models/res_users.py new file mode 100644 index 00000000000..b3c95864a78 --- /dev/null +++ b/attachment_delete_restrict/models/res_users.py @@ -0,0 +1,17 @@ +# Copyright 2021 Quartile (https://www.quartile.co) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ResUsers(models.Model): + _inherit = "res.users" + + delete_attachment_model_ids = fields.Many2many( + "ir.model", + relation="delete_attachment_user_rel", + string="Attachment Deletion Models", + help="The user can delete the attachments related to the models " + "assigned here. Restrict Attachment Deletion must be" + "'Custom' or 'Owner + Custom' for the model to be selected here.", + ) diff --git a/attachment_delete_restrict/pyproject.toml b/attachment_delete_restrict/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/attachment_delete_restrict/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/attachment_delete_restrict/readme/CONFIGURE.md b/attachment_delete_restrict/readme/CONFIGURE.md new file mode 100644 index 00000000000..45deb03b968 --- /dev/null +++ b/attachment_delete_restrict/readme/CONFIGURE.md @@ -0,0 +1,28 @@ +## Select level: + +1. Go to *Settings \> General Settings\> Permission section*. +2. Choose the level of *Restrict Delete Attachment* for all models by + default or for models with "default" restriction level. + +## Five levels: + +- Default : Use global configuration +- Owner : Owner and admins only +- Custom : Certain groups or users per related model. +- Owner + Custom : Owner, admins and Certain groups or users per related + model. +- None : all users can delete them + +Only Custom and Owner + Custom need specific configuration on models. + +## For Custom and Owner + Custom levels: + +1. Go to *Settings \> Technical \> Database Structure \> Models*. +2. Open a model for which attachment deletion should be restricted. +3. Select 'Restrict Attachment Deletion', and assign 'Attachment + Deletion Groups' and/or 'Attachment Deletion Users' as necessary (if + no assignment, no one can delete the attachments of this model). + +For assigning 'Attachment Deletion Groups'/'Attachment Deletion Users' +to the model, you can alternatively add the model in the 'Attachment +Deletion Models' tab in the respective group/user form. diff --git a/attachment_delete_restrict/readme/CONTRIBUTORS.md b/attachment_delete_restrict/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..3c11d9deb8d --- /dev/null +++ b/attachment_delete_restrict/readme/CONTRIBUTORS.md @@ -0,0 +1,3 @@ +- Yoshi Tashiro \<\> +- Kévin Roche \<\> +- Sébastien BEAU \<\> diff --git a/attachment_delete_restrict/readme/DESCRIPTION.md b/attachment_delete_restrict/readme/DESCRIPTION.md new file mode 100644 index 00000000000..4db32eec628 --- /dev/null +++ b/attachment_delete_restrict/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +This module provides the ability to restrict the deletion of the +attachments at different levels. diff --git a/attachment_delete_restrict/static/description/icon.png b/attachment_delete_restrict/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/attachment_delete_restrict/static/description/icon.png differ diff --git a/attachment_delete_restrict/static/description/index.html b/attachment_delete_restrict/static/description/index.html new file mode 100644 index 00000000000..a8bb2023172 --- /dev/null +++ b/attachment_delete_restrict/static/description/index.html @@ -0,0 +1,477 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Restrict Deletion of Attachments

+ +

Beta License: AGPL-3 OCA/server-tools Translate me on Weblate Try me on Runboat

+

This module provides the ability to restrict the deletion of the +attachments at different levels.

+

Table of contents

+ +
+

Configuration

+
+

Select level:

+
    +
  1. Go to Settings > General Settings> Permission section.
  2. +
  3. Choose the level of Restrict Delete Attachment for all models by +default or for models with “default” restriction level.
  4. +
+
+
+

Five levels:

+
    +
  • Default : Use global configuration
  • +
  • Owner : Owner and admins only
  • +
  • Custom : Certain groups or users per related model.
  • +
  • Owner + Custom : Owner, admins and Certain groups or users per +related model.
  • +
  • None : all users can delete them
  • +
+

Only Custom and Owner + Custom need specific configuration on models.

+
+
+

For Custom and Owner + Custom levels:

+
    +
  1. Go to Settings > Technical > Database Structure > Models.
  2. +
  3. Open a model for which attachment deletion should be restricted.
  4. +
  5. Select ‘Restrict Attachment Deletion’, and assign ‘Attachment +Deletion Groups’ and/or ‘Attachment Deletion Users’ as necessary (if +no assignment, no one can delete the attachments of this model).
  6. +
+

For assigning ‘Attachment Deletion Groups’/’Attachment Deletion Users’ +to the model, you can alternatively add the model in the ‘Attachment +Deletion Models’ tab in the respective group/user form.

+
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Quartile
  • +
  • Akretion
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

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.

+

Current maintainers:

+

yostashiro Kev-Roche

+

This module is part of the OCA/server-tools project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+
+ + diff --git a/attachment_delete_restrict/tests/__init__.py b/attachment_delete_restrict/tests/__init__.py new file mode 100644 index 00000000000..c6f40a3f2fb --- /dev/null +++ b/attachment_delete_restrict/tests/__init__.py @@ -0,0 +1 @@ +from . import test_attachment_delete_restrict diff --git a/attachment_delete_restrict/tests/test_attachment_delete_restrict.py b/attachment_delete_restrict/tests/test_attachment_delete_restrict.py new file mode 100644 index 00000000000..2c9eba20fe7 --- /dev/null +++ b/attachment_delete_restrict/tests/test_attachment_delete_restrict.py @@ -0,0 +1,178 @@ +# Copyright 2021 Quartile Limited +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import SUPERUSER_ID, Command +from odoo.exceptions import ValidationError +from odoo.tests import TransactionCase, tagged + + +class AbstractCase: + def test_restrict_none(self): + self._set_restrict_mode("none") + self.attachment.with_user(self.user).unlink() + + def test_restrict_custom_user(self): + self._set_restrict_mode("custom") + with self.assertRaises(ValidationError): + self.attachment.with_user(self.user).unlink() + self._allow_user() + self.attachment.with_user(self.user).unlink() + + def test_restrict_custom_user_with_superuser(self): + self._set_restrict_mode("custom") + self.attachment.with_user(SUPERUSER_ID).unlink() + + def test_restrict_custom_group(self): + self._set_restrict_mode("custom") + with self.assertRaises(ValidationError): + self.attachment.with_user(self.user).unlink() + self._allow_group() + self.attachment.with_user(self.user).unlink() + + def test_restrict_owner(self): + self._set_restrict_mode("owner") + with self.assertRaises(ValidationError): + self.attachment.with_user(self.user).unlink() + self.attachment.with_user(self.user_owner).unlink() + + def test_restrict_owner_admin(self): + self._set_restrict_mode("owner") + self.attachment.with_user(self.user_admin).unlink() + + def test_restrict_owner_and_custom_user_forbidden(self): + self._set_restrict_mode("owner_custom") + with self.assertRaises(ValidationError): + self.attachment.with_user(self.user).unlink() + + def test_restrict_owner_and_custom_user_owner(self): + self._set_restrict_mode("owner_custom") + self.attachment.with_user(self.user_owner).unlink() + + def test_restrict_owner_and_custom_user_admin(self): + self._set_restrict_mode("owner_custom") + self.attachment.with_user(self.user_admin).unlink() + + def test_restrict_owner_and_custom_user(self): + self._set_restrict_mode("owner_custom") + with self.assertRaises(ValidationError): + self.attachment.with_user(self.user).unlink() + self._allow_user() + self.attachment.with_user(self.user).unlink() + + def test_restrict_owner_and_custom_user_group(self): + self._set_restrict_mode("owner_custom") + with self.assertRaises(ValidationError): + self.attachment.with_user(self.user).unlink() + self._allow_group() + self.attachment.with_user(self.user).unlink() + + +@tagged("post_install", "-at_install") +class TestAttachmentDeleteAbstract(TransactionCase): + allow_inherited_tests_method = True + + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.param = cls.env["ir.config_parameter"] + cls.param.set_param( + "attachment_delete_restrict.global_restrict_delete_attachment", "none" + ) + cls.partner_model = cls.env["ir.model"].search([("model", "=", "res.partner")]) + cls.partner_1 = cls.env["res.partner"].create({"name": "partner_1"}) + cls.group = cls.env.ref("base.group_user") + cls.user_owner = cls.env["res.users"].create( + { + "name": "test owner user", + "login": "test-owner@example.com", + "group_ids": [ + Command.set( + [ + cls.env.ref("base.group_user").id, + cls.env.ref("base.group_partner_manager").id, + ] + ) + ], + } + ) + cls.user = cls.env["res.users"].create( + { + "name": "test user", + "login": "test2@example.com", + "group_ids": [ + Command.set( + [ + cls.env.ref("base.group_user").id, + cls.env.ref("base.group_partner_manager").id, + ] + ) + ], + } + ) + cls.user_admin = cls.env["res.users"].create( + { + "name": "User admin", + "login": "admin@example.com", + "group_ids": [ + Command.set( + [ + cls.env.ref("base.group_system").id, + cls.env.ref("base.group_user").id, + cls.env.ref("base.group_partner_manager").id, + ] + ) + ], + } + ) + cls.attachment = ( + cls.env["ir.attachment"] + .with_user(cls.user_owner) + .create( + { + "name": "test attachment 2", + "type": "binary", + "res_model": "res.partner", + "res_id": cls.partner_1.id, + } + ) + ) + + def _set_restrict_mode(self, restrict_mode): + raise NotImplementedError + + def _allow_user(self): + raise NotImplementedError + + def _allow_group(self): + raise NotImplementedError + + +class TestAttachmentDeleteGlobal(TestAttachmentDeleteAbstract, AbstractCase): + def _set_restrict_mode(self, restrict_mode): + self.param.set_param( + "attachment_delete_restrict.global_restrict_delete_attachment", + restrict_mode, + ) + + def _allow_user(self): + self.param.set_param( + "attachment_delete_restrict.global_delete_attachment_user_ids", + self.user.ids, + ) + + def _allow_group(self): + self.param.set_param( + "attachment_delete_restrict.global_delete_attachment_group_ids", + self.group.ids, + ) + + +class TestAttachmentDeleteModel(TestAttachmentDeleteAbstract, AbstractCase): + def _set_restrict_mode(self, restrict_mode): + self.partner_model.write({"restrict_delete_attachment": restrict_mode}) + + def _allow_user(self): + self.partner_model.write({"delete_attachment_user_ids": [(4, self.user.id)]}) + + def _allow_group(self): + self.partner_model.write({"delete_attachment_group_ids": [(4, self.group.id)]}) diff --git a/attachment_delete_restrict/views/ir_model_views.xml b/attachment_delete_restrict/views/ir_model_views.xml new file mode 100644 index 00000000000..c5faef34978 --- /dev/null +++ b/attachment_delete_restrict/views/ir_model_views.xml @@ -0,0 +1,29 @@ + + + + ir.model form + ir.model + + + + + + + + + + + + + + + + diff --git a/attachment_delete_restrict/views/res_config_setting_views.xml b/attachment_delete_restrict/views/res_config_setting_views.xml new file mode 100644 index 00000000000..bbcb99bb171 --- /dev/null +++ b/attachment_delete_restrict/views/res_config_setting_views.xml @@ -0,0 +1,50 @@ + + + + res.config.settings.attachment.delete.restrict + res.config.settings + + + + + + + +
+ Authorized Groups: +
+ +
+ Authorized Users: +
+ +
+
+
+
+
+
+
diff --git a/attachment_delete_restrict/views/res_groups_views.xml b/attachment_delete_restrict/views/res_groups_views.xml new file mode 100644 index 00000000000..3de88487049 --- /dev/null +++ b/attachment_delete_restrict/views/res_groups_views.xml @@ -0,0 +1,24 @@ + + + + res.groups.form + res.groups + + + + + + + + + + + + diff --git a/attachment_delete_restrict/views/res_users_views.xml b/attachment_delete_restrict/views/res_users_views.xml new file mode 100644 index 00000000000..e650756dd3c --- /dev/null +++ b/attachment_delete_restrict/views/res_users_views.xml @@ -0,0 +1,24 @@ + + + + res.users.form + res.users + + + + + + + + + + + +