fix dms_security_inherit
This commit is contained in:
parent
aee315165a
commit
7ab3270bf3
|
|
@ -0,0 +1 @@
|
||||||
|
from . import models
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
'name': 'DMS Security Inherit',
|
||||||
|
'version': '1.0',
|
||||||
|
'author': '',
|
||||||
|
'website': '',
|
||||||
|
'license': 'LGPL-3',
|
||||||
|
'depends': ['dms','documents','base'],
|
||||||
|
'data': [
|
||||||
|
'security/security.xml',
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
'installable': True,
|
||||||
|
'application': False,
|
||||||
|
'auto_install': False,
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
from . import model
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
from odoo import models, api, _
|
||||||
|
from odoo.exceptions import AccessError
|
||||||
|
|
||||||
|
|
||||||
|
class DocumentsDocument(models.Model):
|
||||||
|
_inherit = 'documents.document'
|
||||||
|
|
||||||
|
@api.model_create_multi
|
||||||
|
def create(self, vals_list):
|
||||||
|
if not self.env.su:
|
||||||
|
if not self.env.user.has_group('dms.group_dms_manager'):
|
||||||
|
raise AccessError(
|
||||||
|
_("You don't have permission to create new documents. Only DMS Managers can upload new files.")
|
||||||
|
)
|
||||||
|
return super(DocumentsDocument, self).create(vals_list)
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<odoo>
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<delete model="ir.rule" id="dms.rule_directory_computed_write"/>
|
||||||
|
|
||||||
|
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
Loading…
Reference in New Issue