~openerp-dev/openobject-server/trunk-staging-mat

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?xml version="1.0"?>
<openerp>
    <data noupdate="1">

        <!--
            Users Groups
            Note that the field 'category_id' is set later in
            base/module/module_data.xml
        -->
        <record model="res.groups" id="group_erp_manager">
            <field name="name">Access Rights</field>
        </record>
        <record model="res.groups" id="group_system">
            <field name="name">Settings</field>
            <field name="implied_ids" eval="[(4, ref('group_erp_manager'))]"/>
            <field name="users" eval="[(4, ref('base.user_root'))]"/>
        </record>

        <record model="res.groups" id="group_user">
            <field name="name">Employee</field>
            <field name="users" eval="[(4, ref('base.user_root'))]"/>
        </record>

        <record model="res.groups" id="group_multi_company">
            <field name="name">Multi Companies</field>
        </record>

        <record model="res.groups" id="group_multi_currency">
            <field name="name">Multi Currencies</field>
        </record>

        <record model="res.groups" id="group_no_one">
            <field name="name">Technical Features</field>
        </record>

        <record id="group_sale_salesman" model="res.groups">
            <field name="name">User</field>
        </record>
        <record id="group_sale_manager" model="res.groups">
            <field name="name">Manager</field>
            <field name="implied_ids" eval="[(4, ref('group_sale_salesman'))]"/>
        </record>

        <!-- Set accesses to menu -->
        <record model="ir.ui.menu" id="base.menu_administration">
            <field name="name">Settings</field>
            <field name="groups_id" eval="[(6,0, [ref('group_system'), ref('group_erp_manager')])]"/>
        </record>

        <record model="ir.rule" id="res_partner_rule">
            <field name="name">res.partner company</field>
            <field name="model_id" ref="model_res_partner"/>
            <!--
                Show partners from ancestors and descendants companies
                (or company-less), this is usually a better default for
                multicompany setups.
            -->
            <field name="domain_force">['|','|',('company_id.child_ids','child_of',[user.company_id.id]),('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
        </record>

        <record model="ir.rule" id="res_partner_portal_public_rule">
            <field name="name">res_partner: portal/public: read access on my commercial partner</field>
            <field name="model_id" ref="base.model_res_partner"/>
            <field name="domain_force">[('id', 'child_of', user.commercial_partner_id.id)]</field>
            <field name="groups" eval="[(4, ref('base.group_portal')), (4, ref('base.group_public'))]"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_unlink" eval="False"/>
            <field name="perm_write" eval="False"/>
        </record>

        <record model="ir.rule" id="multi_company_default_rule">
            <field name="name">Multi_company_default company</field>
            <field name="model_id" ref="model_multi_company_default"/>
            <field name="domain_force">[('company_id','child_of',[user.company_id.id])]</field>
        </record>

        <record model="ir.rule" id="ir_values_default_rule">
            <field name="name">Defaults: alter personal values only</field>
            <field name="model_id" ref="model_ir_values"/>
            <field name="domain_force">[('key','=','default'),('user_id','=',user.id)]</field>
            <field name="perm_read" eval="False"/>
        </record>

        <!-- Used for dashboard customizations, users should only be able to edit their own dashboards -->
        <record model="ir.rule" id="ir_ui_view_custom_personal">
            <field name="name">ir.ui.view_custom rule</field>
            <field name="model_id" ref="model_ir_ui_view_custom"/>
            <field name="domain_force">[('user_id','=',user.id)]</field>
        </record>

	<record id="res_partner_bank_rule" model="ir.rule">
	    <field name="name">Partner bank company rule</field>
	    <field name="model_id" ref="model_res_partner_bank"/>
	    <field name="global" eval="True"/>
            <!--
                Same as res_partner above.
            -->
            <field name="domain_force">['|','|',('company_id.child_ids','child_of',[user.company_id.id]),('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
	</record>

        <record id="res_currency_rule" model="ir.rule">
            <field name="name">multi-company currency rule</field>
            <field name="model_id" ref="model_res_currency"/>
            <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
        </record>

    </data>
</openerp>