-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from Merctrans/feature/create-user-group
created 2 new user groups
- Loading branch information
Showing
6 changed files
with
94 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from . import controllers | ||
from . import models | ||
from . import models | ||
|
||
# admin can see all contributors and all POs that they are creating: old/ current and upcoming |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||
access_sample_module_sample_module,sample_module.sample_module,model_sample_module_sample_module,base.group_user,1,1,1,1 | ||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<data> | ||
<!-- create 2 groups: PM, contributor - assign different rights (he will give sample) --> | ||
<record model="ir.module.category" id="module_category_morons"> | ||
<field name="name">Morons</field> | ||
</record> | ||
|
||
<!-- Update the group to use this category --> | ||
<record id="group_contributors" model="res.groups"> | ||
<field name="name">Contributors</field> | ||
<field name="category_id" ref="module_category_morons"/> | ||
</record> | ||
|
||
<record id="group_pm" model="res.groups"> | ||
<field name="name">PM</field> | ||
<field name="category_id" ref="module_category_morons"/> | ||
</record> | ||
|
||
<!-- Create CRUD rights --> | ||
<record id="module_category_contributor_access" model="ir.model.access"> | ||
<field name="name">Contributor access</field> | ||
<field name="model_id" ref="morons.model_project_task"/> | ||
<field name="group_id" ref="morons.group_contributors"/> | ||
<field name="perm_read" eval="1"/> | ||
<field name="perm_write" eval="0"/> | ||
<field name="perm_create" eval="0"/> | ||
<field name="perm_unlink" eval="0"/> | ||
</record> | ||
|
||
<record id="module_category_pm_access" model="ir.model.access"> | ||
<field name="name">PM access</field> | ||
<field name="model_id" ref="morons.model_project_task"/> | ||
<field name="group_id" ref="morons.group_pm"/> | ||
<field name="perm_read" eval="1"/> | ||
<field name="perm_write" eval="1"/> | ||
<field name="perm_create" eval="1"/> | ||
<field name="perm_unlink" eval="1"/> | ||
</record> | ||
|
||
<!-- Rule for normal users --> | ||
<!-- <record id="rule_supreme_court_letter_own" model="ir.rule"> | ||
<field name="name">Supreme Court Letter Own</field> | ||
<field name="model_id" ref="supco.model_supreme_court_letter"/> | ||
<field name="domain_force">[('created_by', '=', user.id)]</field> | ||
<field name="groups" eval="[(4, ref('base.group_user'))]"/> | ||
</record> --> | ||
|
||
<record model="ir.rule" id="rule_po_contributor_access"> | ||
<field name="name">PO Contributor Access</field> | ||
<field name="model_id" ref="morons.model_project_task"/> | ||
<field name="domain_force">[('user_id','=',user.id)]</field> | ||
<field name="groups" eval="[( 4, ref('morons.group_contributors'))]"/> | ||
</record> | ||
|
||
|
||
<record model="ir.rule" id="rule_po_pm_access"> | ||
<field name="name">PO PM Access</field> | ||
<field name="model_id" ref="morons.model_project_task"/> | ||
<field name="domain_force">[('user_id','=',user.id)]</field> | ||
<field name="groups" eval="[(4, ref('morons.group_pm'))]"/> | ||
</record> | ||
|
||
<!-- Rule for first approver --> | ||
<!-- <record id="rule_supreme_court_letter_first_approval" model="ir.rule"> | ||
<field name="name">Supreme Court Letter First Approval</field> | ||
<field name="model_id" ref="supco.model_supreme_court_letter"/> | ||
<field name="domain_force">['|', '|', '|', ('created_by', '=', user.id), '&', ('created_by', '!=', | ||
user.id), | ||
('approval_status', '=', 'waiting_first_approval'), ('approval_status', '=', 'waiting_second_approval'), | ||
('reject_by', '=', user.id)] | ||
</field> | ||
<field name="groups" eval="[(4, ref('supco.group_first_approval'))]"/> | ||
</record> --> | ||
|
||
<!-- <record id="rule_supreme_court_letter_second_approval" model="ir.rule"> | ||
<field name="name">Supreme Court Letter Second Approval</field> | ||
<field name="model_id" ref="supco.model_supreme_court_letter"/> | ||
<field name="domain_force">['|', '|', ('created_by', '=', user.id), '|', ('approval_status', '=', | ||
'waiting_second_approval'), | ||
('approval_status', '=', 'approved'), ('reject_by', '=', user.id)] | ||
</field> | ||
<field name="groups" eval="[(4, ref('supco.group_second_approval'))]"/> | ||
</record> --> | ||
</data> | ||
</odoo> |