[UPD] dms: add permission to delete files in dms
This commit is contained in:
parent
680bef74a1
commit
598053bd35
|
|
@ -2694,6 +2694,11 @@ msgstr "مسار جيسون"
|
||||||
msgid "Path Names"
|
msgid "Path Names"
|
||||||
msgstr "اسم المسار"
|
msgstr "اسم المسار"
|
||||||
|
|
||||||
|
#. module: dms
|
||||||
|
#: model:res.groups,name:dms.group_dms_delete_file
|
||||||
|
msgid "Permission to delete Files"
|
||||||
|
msgstr "صلاحية حذف الملفات"
|
||||||
|
|
||||||
#. module: dms
|
#. module: dms
|
||||||
#: model:res.groups,name:dms.group_dms_delete_directory
|
#: model:res.groups,name:dms.group_dms_delete_directory
|
||||||
msgid "Permission to delete Folders/Directories"
|
msgid "Permission to delete Folders/Directories"
|
||||||
|
|
@ -3571,6 +3576,12 @@ msgstr "امكانية التعديل "
|
||||||
msgid "Write a tooltip for the action here"
|
msgid "Write a tooltip for the action here"
|
||||||
msgstr "اكتب تلميحًا للإجراء هنا"
|
msgstr "اكتب تلميحًا للإجراء هنا"
|
||||||
|
|
||||||
|
#. module: dms
|
||||||
|
#: code:addons/dms/models/document.py:0
|
||||||
|
#, python-format
|
||||||
|
msgid "You are not allowed to delete a file!"
|
||||||
|
msgstr "ليس مسموح لك بحذف ملف!"
|
||||||
|
|
||||||
#. module: dms
|
#. module: dms
|
||||||
#: code:addons/dms/models/directory.py:0
|
#: code:addons/dms/models/directory.py:0
|
||||||
#, python-format
|
#, python-format
|
||||||
|
|
|
||||||
|
|
@ -696,6 +696,13 @@ class Document(models.Model):
|
||||||
|
|
||||||
return write_result
|
return write_result
|
||||||
|
|
||||||
|
def unlink(self):
|
||||||
|
if not self.env.user.has_group("dms.group_dms_delete_file") and not self.env.user.id == 1:
|
||||||
|
raise ValidationError(
|
||||||
|
_("You are not allowed to delete a file!")
|
||||||
|
)
|
||||||
|
return super(Document, self).unlink()
|
||||||
|
|
||||||
def _process_activities(self, attachment_id):
|
def _process_activities(self, attachment_id):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
if attachment_id and self.request_activity_id:
|
if attachment_id and self.request_activity_id:
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,9 @@
|
||||||
<field name="category_id" ref="dms.category_dms_security"/>
|
<field name="category_id" ref="dms.category_dms_security"/>
|
||||||
<field name="users" eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]" />
|
<field name="users" eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]" />
|
||||||
</record>
|
</record>
|
||||||
|
<record id="group_dms_delete_file" model="res.groups">
|
||||||
|
<field name="name">Permission to delete Files</field>
|
||||||
|
</record>
|
||||||
<record id="group_dms_delete_directory" model="res.groups">
|
<record id="group_dms_delete_directory" model="res.groups">
|
||||||
<field name="name">Permission to delete Folders/Directories</field>
|
<field name="name">Permission to delete Folders/Directories</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue