Commit fdb48f72 authored by Luca Cristaldi's avatar Luca Cristaldi

Add permissions

parent d89e3c4c
<?xml version="1.0" ?>
<tryton>
<data depends="">
<!-- Create groups -->
<!-- Groups -->
<record model="res.group" id="group_association">
<field name="name">Association</field>
</record>
<record model="res.group" id="group_association_admin">
<field name="name">Association Administrator</field>
</record>
<record model="res.group" id="group_member_approval">
<field name="name">Member Approval</field>
</record>
<!-- Grant administation privileges to 'admin' -->
<record model="res.user-res.group" id="user_admin_group_association">
<field name="user" ref="res.user_admin" />
......@@ -17,17 +20,16 @@
<field name="user" ref="res.user_admin" />
<field name="group" ref="group_association_admin" />
</record>
<!-- Add user triggers -->
<!-- <record model="res.user-res.group" id="user_trigger_group_association">
<field name="user" ref="res.user_trigger" />
<field name="group" ref="group_association" />
</record> -->
<!-- <record model="res.user-res.group" id="user_trigger_group_association_admin">
<field name="user" ref="res.user_trigger" />
<field name="group" ref="group_association_admin" />
</record> -->
<record model="res.user-res.group" id="user_admin_group_member_approval">
<field name="user" ref="res.user_admin" />
<field name="group" ref="group_member_approval" />
</record>
<menuitem name="Association" sequence="0" id="menu_association" icon="tryton-party" />
<menuitem name="Configuration" parent="menu_association" id="menu_configuration" sequence="0" icon="tryton-settings" />
<record model="ir.ui.menu-res.group" id="menu_configuration_group_association_admin">
<field name="menu" ref="menu_configuration" />
<field name="group" ref="group_association_admin" />
</record>
<record model="ir.ui.view" id="members_view_tree">
<field name="model">association.member</field>
<field name="type">tree</field>
......@@ -99,18 +101,42 @@
<record model="ir.model.access" id="access_member">
<field name="model" search="[('model', '=', 'association.member')]" />
<field name="perm_read" eval="True" />
<field name="perm_write" eval="False" />
<field name="perm_create" eval="False" />
<field name="perm_delete" eval="False" />
<field name="perm_write" eval="True" />
<field name="perm_create" eval="True" />
<field name="perm_delete" eval="True" />
</record>
<record model="ir.model.access" id="access_member_admin">
<field name="model" search="[('model', '=', 'association.member')]" />
<field name="group" ref="party.group_party_admin" />
<field name="group" ref="group_association_admin" />
<field name="perm_read" eval="True" />
<field name="perm_write" eval="True" />
<field name="perm_create" eval="True" />
<field name="perm_delete" eval="True" />
</record>
<record model="ir.model.button-res.group" id="member_run_button_group_member_approval">
<field name="button" ref="member_run_button" />
<field name="group" ref="group_member_approval" />
</record>
<record model="ir.model.button-res.group" id="member_draft_button_group_member_approval">
<field name="button" ref="member_draft_button" />
<field name="group" ref="group_member_approval" />
</record>
<record model="ir.model.button-res.group" id="member_approve_stop_group_member_approval">
<field name="button" ref="member_stop_button" />
<field name="group" ref="group_member_approval" />
</record>
<record model="ir.model.button-res.group" id="member_run_button_group_association_admin">
<field name="button" ref="member_run_button" />
<field name="group" ref="group_association_admin" />
</record>
<record model="ir.model.button-res.group" id="member_draft_button_group_association_admin">
<field name="button" ref="member_draft_button" />
<field name="group" ref="group_association_admin" />
</record>
<record model="ir.model.button-res.group" id="member_approve_stop_group_association_admin">
<field name="button" ref="member_stop_button" />
<field name="group" ref="group_association_admin" />
</record>
<!-- Sequence -->
<record model="ir.sequence.type" id="sequence_type_member">
<field name="name">Member</field>
......
......@@ -415,7 +415,7 @@ class Fee(ModelSQL, ModelView):
class PostFee(Wizard):
'Post Fee'
__name__ = 'association.membership.fee_move'
__name__ = 'association.membership.post_fee'
start_state = 'post'
post = StateTransition()
......
......@@ -32,7 +32,42 @@
<field name="priority" eval="20" />
<field name="name">membership_period_tree_editable</field>
</record>
<record model="ir.model.access" id="access_membership">
<field name="model" search="[('model', '=', 'association.membership')]" />
<field name="perm_read" eval="True" />
<field name="perm_write" eval="False" />
<field name="perm_create" eval="False" />
<field name="perm_delete" eval="False" />
</record>
<record model="ir.model.access" id="access_membership_member_approval">
<field name="model" search="[('model', '=', 'association.membership')]" />
<field name="group" ref="group_member_approval" />
<field name="perm_read" eval="True" />
<field name="perm_write" eval="True" />
<field name="perm_create" eval="True" />
<field name="perm_delete" eval="True" />
</record>
<record model="ir.model.access" id="access_membership_admin">
<field name="model" search="[('model', '=', 'association.membership')]" />
<field name="group" ref="group_association_admin" />
<field name="perm_read" eval="True" />
<field name="perm_write" eval="True" />
<field name="perm_create" eval="True" />
<field name="perm_delete" eval="True" />
</record>
<record model="ir.model.access" id="access_membership_group_association">
<field name="model" search="[('model', '=', 'association.membership')]" />
<field name="group" ref="group_association" />
<field name="perm_read" eval="True" />
<field name="perm_write" eval="True" />
<field name="perm_create" eval="True" />
<field name="perm_delete" eval="True" />
</record>
<menuitem name="Memberships" sequence="20" parent="menu_configuration" id="menu_membership" action="act_membership_form" icon="tryton-list" />
<record model="ir.ui.menu-res.group" id="menu_membership_group_association_admin">
<field name="menu" ref="menu_membership" />
<field name="group" ref="group_association_admin" />
</record>
<!-- membership fee -->
<record model="ir.ui.view" id="membership_fee_view_tree">
<field name="model">association.membership.fee</field>
......@@ -56,26 +91,39 @@
<field name="act_window" ref="membership_fee_view_form" />
</record>
<record model="ir.action.act_window.view" id="act_fee_form2">
<field name="sequence">10</field>
<field name="sequence">20</field>
<field name="view" ref="membership_fee_view_form" />
<field name="act_window" ref="membership_fee_view_tree" />
</record>
<record model="ir.model.access" id="access_membership_fee">
<field name="model" search="[('model', '=', 'association.membership.fee')]" />
<field name="perm_read" eval="True" />
<field name="perm_write" eval="False" />
<field name="perm_create" eval="False" />
<field name="perm_delete" eval="False" />
</record>
<record model="ir.model.access" id="access_membership_fee_admin">
<field name="model" search="[('model', '=', 'association.membership.fee')]" />
<field name="group" ref="group_association_admin" />
<field name="perm_read" eval="True" />
<field name="perm_write" eval="True" />
<field name="perm_create" eval="True" />
<field name="perm_delete" eval="True" />
</record>
<menuitem name="Fees" sequence="30" parent="menu_association" id="menu_fee" action="act_fee_form" icon="tryton-list" />
<!-- Fee action generate/post move -->
<!-- post Fee -->
<record model="ir.model.button" id="membership_fee_button">
<field name="name">post_move</field>
<field name="string">Post</field>
<field name="string">Post Fee</field>
<field name="model" search="[('model', '=', 'association.membership.fee')]" />
</record>
<record model="ir.action.wizard" id="act_generate_move">
<field name="name">Generate Fee move</field>
<field name="wiz_name">association.membership.fee_move</field>
<field name="model">association.membership.fee</field>
<record model="ir.model.button-res.group" id="post_button_group_member_approval">
<field name="button" ref="membership_fee_button" />
<field name="group" ref="group_member_approval" />
</record>
<record model="ir.action.keyword" id="membership_fee_action_keyword">
<field name="keyword">form_action</field>
<field name="model">association.membership.fee,-1</field>
<field name="action" ref="act_generate_move" />
<record model="ir.model.button-res.group" id="psot_button_group_member_approval">
<field name="button" ref="membership_fee_button" />
<field name="group" ref="group_association_admin" />
</record>
<!-- Fee wizard -->
<record model="ir.action.wizard" id="act_membership_fee_create">
......@@ -92,7 +140,23 @@
<field name="type">form</field>
<field name="name">membership_fee_wizard_form</field>
</record>
<record model="ir.action-res.group" id="wizard_membership_fee_group_admin">
<field name="action" ref="act_membership_fee_create" />
<field name="group" ref="group_association_admin" />
</record>
<record model="ir.action-res.group" id="wizard_membership_fee_group_member_approval">
<field name="action" ref="act_membership_fee_create" />
<field name="group" ref="group_member_approval" />
</record>
<menuitem parent="menu_association" sequence="90" action="act_membership_fee_create" id="menu_act_membership_fee_create" />
<record model="ir.ui.menu-res.group" id="menu_act_membership_fee_create_group_member_approval">
<field name="menu" ref="menu_act_membership_fee_create" />
<field name="group" ref="group_member_approval" />
</record>
<record model="ir.ui.menu-res.group" id="menu_act_membership_fee_create_group_association_admin">
<field name="menu" ref="menu_act_membership_fee_create" />
<field name="group" ref="group_association_admin" />
</record>
<!-- membership line -->
<record model="ir.ui.view" id="membership_line_view_tree_editable">
<field name="model">association.membership.line</field>
......@@ -100,6 +164,29 @@
<field name="priority" eval="30" />
<field name="name">membership_line_tree_editable</field>
</record>
<record model="ir.model.access" id="access_membership_line">
<field name="model" search="[('model', '=', 'association.membership.line')]" />
<field name="perm_read" eval="True" />
<field name="perm_write" eval="False" />
<field name="perm_create" eval="False" />
<field name="perm_delete" eval="False" />
</record>
<record model="ir.model.access" id="access_membership_line_admin">
<field name="model" search="[('model', '=', 'association.membership.line')]" />
<field name="group" ref="group_association_admin" />
<field name="perm_read" eval="True" />
<field name="perm_write" eval="True" />
<field name="perm_create" eval="True" />
<field name="perm_delete" eval="True" />
</record>
<record model="ir.model.access" id="access_membership_line_group_association">
<field name="model" search="[('model', '=', 'association.membership.line')]" />
<field name="group" ref="group_association" />
<field name="perm_read" eval="True" />
<field name="perm_write" eval="True" />
<field name="perm_create" eval="True" />
<field name="perm_delete" eval="True" />
</record>
<!-- membership period -->
<record model="ir.ui.view" id="view_membership_period_tree">
<field name="model">association.membership.period</field>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment