-
Notifications
You must be signed in to change notification settings - Fork 3
/
saleagent_view.xml
147 lines (130 loc) · 6.67 KB
/
saleagent_view.xml
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<?xml version="1.0"?>
<openerp>
<data>
<!--
=======================
Saleagent Information
=======================
-->
<record model="ir.ui.view" id="view_saleagent_tree">
<field name="name">saleagent.info.tree</field>
<field name="model">sale.agent</field>
<field name="arch" type="xml">
<tree string="Saleagent">
<field name="code" select="1"/>
<field name="name" select="1"/>
<field name="active" select="1"/>
<field name="partner_id" select="1" />
<field name="commission" select="1"/>
<field name="settlement"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_saleagent_form">
<field name="name">saleagent.info.form</field>
<field name="model">sale.agent</field>
<field name="arch" type="xml">
<form string="Agent" col="6">
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="type" select="1"/>
<group string="Related entity or employee" colspan="2">
<field attrs="{'required':[('type','=','asesor')], 'invisible':[('type','!=','asesor')]}" domain="[('agent','=',True)]" name="partner_id" select="2"/>
<field attrs="{'required':[('type','=','comercial')], 'invisible':[('type','!=','comercial')]}" name="employee_id" select="2"/>
</group>
<field domain="[('parent_id','=',False),('type_tax_use','<>','purchase')]" name="retention_id"/>
<!--label colspan="2"/-->
<field name="active"/>
<notebook colspan="4">
<page string="Commission">
<group>
<field name="settlement"/>
</group>
<group>
<field name="commission"/>
</group>
</page>
<page string="Customer assigned">
<field colspan="4" name="customer" nolabel="1" readonly="1"/>
</page>
<page string="Settlements executed">
<field colspan="4" name="settlement_ids" nolabel="1" readonly="1"/>
</page>
</notebook>
</form>
</field>
</record>
<record id="view_sale_agen_search model" model="ir.ui.view">
<field name="name">commission.sale.agent.search</field>
<field name="model">sale.agent</field>
<field name="arch" type="xml">
<search string="Search Agent">
<group>
<filter icon="terp-personal" string="Commercial" domain="[('type','=','comercial')]"/>
<filter icon="terp-personal" string="Adviser" domain="[('type','=','asesor')]"/>
<field name="code"/>
<field name="name"/>
<field name="commission"/>
<field name="settlement"/>
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="Commission" context="{'group_by': 'commission'}" icon="terp-dolar"/>
<filter string="Settlement" context="{'group_by': 'settlement'}" icon="terp-dolar"/>
</group>
</search>
</field>
</record>
<record model="ir.actions.act_window" id="action_saleagent_form">
<field name="name">Sale agents</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.agent</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_saleagent_tree"/>
</record>
<record model="ir.ui.view" id="commission_tree">
<field name="name">commission.tree</field>
<field name="model">commission</field>
<field name="arch" type="xml">
<tree string="Commissions">
<field name="name" select="1"/>
<field name="type" select="1"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="commission_form">
<field name="name">Commissions</field>
<field name="model">commission</field>
<field name="arch" type="xml">
<form string="Commission">
<separator string="General info." colspan="4"/>
<field name="name" select="1"/>
<field name="type" select="1"/>
<group string="Definition of rates" colspan="4">
<field name="fix_qty" attrs="{'invisible':[('type','!=','fijo')]}"/>
<field name="sections" widget="one2many_list" colspan="4" nolabel="1" attrs="{'invisible':[('type','!=','tramos')]}">
<tree string="sections" editable="top">
<field name="commission_from"/>
<field name="commission_until"/>
<field name="percent"/>
</tree>
</field>
</group>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_commission_form">
<field name="name">Commission Types</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">commission</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="commission_tree"/>
</record>
<menuitem name="Commissions" id="menu_sale_commissions" parent="base.menu_base_partner"/>
<menuitem name="Sale agents" id="menu_sale_commissions_agent" parent="menu_sale_commissions" action="action_saleagent_form" sequence="10"/>
<menuitem name="Commissions" id="menu_sale_commissions_conf" parent="base.menu_base_config"/>
<menuitem name="Commission Types" id="menu_sale_commissions_types" parent="menu_sale_commissions_conf" action="action_commission_form"/>
</data>
</openerp>