Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
odoo
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cooperatic-foodcoops
odoo
Commits
c9fc08cf
Commit
c9fc08cf
authored
Apr 02, 2021
by
François C.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add 'for memo files' related to web_access_buttons changes
parent
c1b4c2ef
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
111 additions
and
0 deletions
+111
-0
web_access_buttons.py.vLouve
...ddons/coop_membership/models/web_access_buttons.py.vLouve
+58
-0
web_access_buttons_changed.py
...dons/coop_membership/models/web_access_buttons_changed.py
+53
-0
No files found.
intercoop_addons/coop_membership/models/web_access_buttons.py.vLouve
0 → 100644
View file @
c9fc08cf
# -*- coding: utf-8 -*-
from openerp import models, api, exceptions
from openerp import SUPERUSER_ID
@api.multi
def check_access_buttons(self):
"""
Check group current user to hide buttons
"""
presence_group = self.env.user.has_group(
'coop_membership.group_membership_bdm_presence')
lecture_group = self.env.user.has_group(
'coop_membership.group_membership_bdm_lecture')
saisie_group = self.env.user.has_group(
'coop_membership.group_membership_bdm_saisie')
deceased_group = self.env.user.has_group(
'coop_membership.group_membership_view_partner_deceased')
manager_group = self.env.user.has_group(
'coop_membership.group_membership_access_manager')
writer_group = self.env.user.has_group(
'coop_membership.group_membership_access_edit')
if self.env.user.id == SUPERUSER_ID:
return False
elif self._name == 'res.partner':
if presence_group and not (manager_group and writer_group):
return 'presence_group_partner'
if lecture_group and not deceased_group:
return 'lecture_group_partner'
if saisie_group:
return 'saisie_group_partner'
elif self._name == 'shift.shift':
if presence_group and not (manager_group and writer_group):
return 'presence_group_shift'
if lecture_group and not deceased_group:
return 'lecture_group_shift'
if saisie_group:
return 'saisie_group_shift'
elif self._name == "shift.leave":
if saisie_group:
return 'saisie_group_leave'
elif self._name == "shift.registration":
if saisie_group:
return 'saisie_group_registration'
elif self._name == "shift.template.registration.line":
if saisie_group:
return 'saisie_group_template_registration_line'
elif self._name == "shift.extension":
if saisie_group:
return 'saisie_group_extension'
else:
return False
models.BaseModel.check_access_buttons = check_access_buttons
intercoop_addons/coop_membership/models/web_access_buttons_changed.py
0 → 100644
View file @
c9fc08cf
# -*- coding: utf-8 -*-
from
openerp
import
models
,
api
,
exceptions
from
openerp
import
SUPERUSER_ID
@api.multi
def
check_access_buttons
(
self
):
"""
Check group current user to hide buttons
"""
presence_group
=
self
.
env
.
user
.
has_group
(
'coop_membership.group_membership_bdm_presence'
)
lecture_group
=
self
.
env
.
user
.
has_group
(
'coop_membership.group_membership_bdm_lecture'
)
saisie_group
=
self
.
env
.
user
.
has_group
(
'coop_membership.group_membership_bdm_saisie'
)
deceased_group
=
self
.
env
.
user
.
has_group
(
'coop_membership.group_membership_view_partner_deceased'
)
if
self
.
env
.
user
.
id
==
SUPERUSER_ID
:
return
False
elif
self
.
_name
==
'res.partner'
:
if
saisie_group
:
return
'saisie_group_partner'
if
presence_group
:
return
'presence_group_partner'
if
lecture_group
and
not
deceased_group
:
return
'lecture_group_partner'
elif
self
.
_name
==
'shift.shift'
:
if
presence_group
:
return
'presence_group_shift'
if
lecture_group
and
not
deceased_group
:
return
'lecture_group_shift'
if
saisie_group
:
return
'saisie_group_shift'
elif
self
.
_name
==
"shift.leave"
:
if
saisie_group
:
return
'saisie_group_leave'
elif
self
.
_name
==
"shift.registration"
:
if
saisie_group
:
return
'saisie_group_registration'
elif
self
.
_name
==
"shift.template.registration.line"
:
if
saisie_group
:
return
'saisie_group_template_registration_line'
elif
self
.
_name
==
"shift.extension"
:
if
saisie_group
:
return
'saisie_group_extension'
else
:
return
False
models
.
BaseModel
.
check_access_buttons
=
check_access_buttons
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment