forked from acsone/project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhours_block_view.xml
172 lines (155 loc) · 8.06 KB
/
hours_block_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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<?xml version="1.0" ?>
<openerp>
<data>
<!--
Hours block search form
-->
<record id="view_account_invoice_filter" model="ir.ui.view">
<field name="name">account.hours.block.select</field>
<field name="model">account.hours.block</field>
<field name="arch" type="xml">
<search string="Search Invoice">
<group col="7" colspan="4">
<filter name="draft" icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Hours Blocks"/>
<filter name="running" icon="terp-dolar" string="Running" domain="[('close_date','=',False),('state','<>','draft')]" help="All Running Hours Block"/>
<separator orientation="vertical"/>
<filter name="overdue" icon="terp-dolar_ok!" string="Overdue" domain="[('amount_hours_block_delta','<','0.0')]" help="Overdue Hours Block"/>
<separator orientation="vertical"/>
<field name="number"/>
<field name="partner_id"/>
<field name="department_id" string="Department"/>
<field name="user_id" select="1" widget="selection" string="Salesman">
<filter domain="[('user_id','=',uid)]" help="My invoices" icon="terp-personal" separator="1"/>
</field>
<field name="company_id" widget="selection"/>
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
<filter string="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<filter string="Department" icon="terp-personal" domain="[]" context="{'group_by':'department_id'}"/>
<filter string="Invoice State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
</group>
</search>
</field>
</record>
<!--
Hours Block View
-->
<record id="hours_block_invoice_form" model="ir.ui.view">
<field name="name">account.hours.block.form</field>
<field name="model">account.hours.block</field>
<field name="arch" type="xml">
<form string="Hours Blocks" version="7.0">
<header>
<button name="action_send_block" type="object" string="Send by Email" class="oe_highlight"/>
</header>
<sheet>
<h1>
<field name="invoice_id" placeholder="Choose an invoice..."/>
<label for="type" string="Based on:" class="oe_inline"/>
<field name="type" class="oe_inline"/>
</h1>
<group>
<field name="last_action_date" />
<field name="close_date" />
</group>
<group>
<separator colspan="4" string="Hours Quantity / Amount"/>
<field name="amount_hours_block" string="Bought"/>
<field name="amount_hours_block_done" string="Used"/>
<field name="amount_hours_block_delta" string="Difference"/>
</group>
<group>
<separator colspan="4" string="Invoice's related information"/>
<field name="date_invoice"/>
<field name="name"/>
<field name="number"/>
<field name="partner_id" groups="base.group_user"/>
<field name="user_id"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<field name="department_id" widget="selection"/>
<field name="journal_id" invisible="1"/>
<field name="period_id" invisible="1" groups="account.group_account_user"/>
<field name="currency_id"/>
<newline/>
<field name="residual" sum="Residual Amount"/>
<field name="amount_total" sum="Total Amount"/>
<field name="state"/>
</group>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
</record>
<record model="ir.ui.view" id="invoice_tree_hour_block">
<field name="name">account.hours.block.tree</field>
<field name="model">account.hours.block</field>
<field name="arch" type="xml">
<tree colors="blue:state in ('draft');black:state in ('proforma','proforma2','open');gray:state in ('cancel')" string="Invoice">
<field name="date_invoice"/>
<field name="partner_id" groups="base.group_user"/>
<field name="name"/>
<field name="amount_hours_block" sum="Quantity of hours bought"/>
<field name="amount_hours_block_done" sum="Quantity of hours used" />
<field name="amount_hours_block_delta" sum="Quantity of hours difference"/>
<field name="last_action_date" />
<field name="close_date" />
<field name="journal_id" invisible="1"/>
<field name="period_id" invisible="1" groups="account.group_account_user"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<field name="department_id" widget="selection"/>
<field name="user_id"/>
<field name="currency_id"/>
<field name="residual" sum="Residual Amount"/>
<field name="amount_total" sum="Total Amount"/>
<field name="state"/>
</tree>
</field>
</record>
<!--
Add related act_window from partner and Hours Block
-->
<act_window name="All blocks hours"
domain="[('partner_id', '=', active_id)]"
res_model="account.hours.block"
src_model="res.partner"
id="act_block_hour_from_partner"/>
<!--
Link to invoice on hours block view
-->
<act_window
domain="[('account_hours_block_ids', '=', active_id)]"
id="act_invoice_from_hours_block"
name="Invoice"
res_model="account.invoice"
src_model="account.hours.block"
view_mode="tree,form"
view_type="form"/>
<!--
Link to analytic lines on hours block view
-->
<act_window
domain="[('invoice_id.account_hours_block_ids', '=', active_id)]"
id="act_analytic_lines_from_hours_block"
name="Analytic Lines"
res_model="account.analytic.line"
src_model="account.hours.block"
view_mode="tree,form"
view_type="form"/>
<!--
Link to hours block on invoice view
-->
<act_window
domain="[('invoice_id', '=', active_id)]"
id="act_hours_block_from_invoice"
name="Hours Block"
res_model="account.hours.block"
src_model="account.invoice"
view_mode="tree,form,calendar,graph"
view_type="form"/>
</data>
</openerp>