-
-
Notifications
You must be signed in to change notification settings - Fork 168
/
Copy pathmaintenance_request_views.xml
158 lines (158 loc) · 6.8 KB
/
maintenance_request_views.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
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="timesheet_action_from_request" model="ir.actions.act_window">
<field name="name">Timesheets</field>
<field name="res_model">account.analytic.line</field>
<field name="search_view_id" ref="hr_timesheet_line_search" />
<field
name="domain"
>[('project_id', '!=', False), ('maintenance_request_id', '!=', False)]</field>
</record>
<record
id="timesheet_action_view_from_request_list"
model="ir.actions.act_window.view"
>
<field name="sequence" eval="5" />
<field name="view_mode">list</field>
<field name="view_id" ref="hr_timesheet.timesheet_view_tree_user" />
<field name="act_window_id" ref="timesheet_action_from_request" />
</record>
<record
id="timesheet_action_view_from_request_form"
model="ir.actions.act_window.view"
>
<field name="sequence" eval="10" />
<field name="view_mode">form</field>
<field name="view_id" ref="hr_timesheet_line_form" />
<field name="act_window_id" ref="timesheet_action_from_request" />
</record>
<!-- maintenance.request: view inheritance -->
<record id="hr_equipment_request_view_tree" model="ir.ui.view">
<field name="model">maintenance.request</field>
<field name="inherit_id" ref="maintenance.hr_equipment_request_view_tree" />
<field name="arch" type="xml">
<field name="stage_id" position="after">
<field
name="timesheet_total_hours"
groups="maintenance.group_equipment_manager"
widget="timesheet_uom"
/>
</field>
</field>
</record>
<record id="hr_equipment_request_view_kanban" model="ir.ui.view">
<field name="model">maintenance.request</field>
<field name="inherit_id" ref="maintenance.hr_equipment_request_view_kanban" />
<field name="arch" type="xml">
<xpath expr="//field[@name='archive']" position="before">
<field
name="timesheet_total_hours"
groups="hr_timesheet.group_hr_timesheet_user"
/>
</xpath>
<xpath expr="//footer//field[@name='activity_ids']" position="after">
<a
class="o_project_kanban_box"
name="action_view_timesheet_ids"
type="object"
groups="hr_timesheet.group_hr_timesheet_user"
>
<div>
<span class="o_value">
<field
name="timesheet_total_hours"
class="oe_inline"
widget="timesheet_uom"
/>
</span>
<span class="oe_label">Hours</span>
</div>
</a>
</xpath>
</field>
</record>
<record id="hr_equipment_request_view_form" model="ir.ui.view">
<field name="model">maintenance.request</field>
<field name="inherit_id" ref="base_maintenance.equipment_request_view_form" />
<field name="arch" type="xml">
<xpath expr="//div[@name='button_box']" position="inside">
<button
class="oe_stat_button"
type="object"
name="action_view_timesheet_ids"
icon="fa-calendar"
groups="hr_timesheet.group_hr_timesheet_user"
>
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
<field
name="timesheet_total_hours"
widget="timesheet_uom"
/>
</span>
<span class="o_stat_text">
Hours
</span>
</div>
</button>
</xpath>
</field>
</record>
<record id="equipment_request_view_form" model="ir.ui.view">
<field name="model">maintenance.request</field>
<field name="inherit_id" ref="base_maintenance.equipment_request_view_form" />
<field name="arch" type="xml">
<page name="description_page" position="after">
<page
string="Timesheets"
name="timesheets"
invisible="not project_id"
groups="hr_timesheet.group_hr_timesheet_user"
>
<group>
<group>
<field name="planned_hours" widget="float_time" />
</group>
<group>
<field name="progress" widget="progressbar" />
</group>
</group>
<field
name="timesheet_ids"
context="{'default_project_id': project_id, 'default_task_id': task_id}"
>
<list editable="bottom" delete="true">
<field name="company_id" column_invisible="True" />
<field name="project_id" column_invisible="True" />
<field name="task_id" column_invisible="True" />
<field name="date" widget="date" />
<field name="user_id" required="1" />
<field name="name" />
<field
name="unit_amount"
string="Duration (Hour(s))"
widget="float_time"
/>
</list>
<form>
<group>
<field name="date" />
<field name="user_id" />
<field name="name" />
<field
name="unit_amount"
string="Duration (Hour(s))"
widget="float_time"
/>
</group>
</form>
</field>
<group class="oe_subtotal_footer oe_right">
<field name="timesheet_total_hours" widget="float_time" />
<field name="remaining_hours" widget="float_time" />
</group>
</page>
</page>
</field>
</record>
</odoo>