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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
|
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- Inherit the preference view to remove title, image and footer -->
<!-- This view is meant to be included in the employee profile view -->
<!-- It ensures that if the 'normal' Preferences view is changed, it's
also reflected in the employee's profile -->
<record id="res_users_view_form_simple_modif" model="ir.ui.view">
<field name="name">res.users.preferences.form.simplified.inherit</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form_simple_modif"/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<footer position="replace"/>
<h1 position="replace"/>
<xpath expr="//field[@name='image_1920']" position="replace"/>
<xpath expr="//field[@name='company_id']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
</field>
</record>
<record id="view_users_form_simple_modif_resource" model="ir.ui.view">
<field name="name">res.users.preferences.form.resource</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form_simple_modif" />
<field name="arch" type="xml">
<field name="tz" position="attributes">
<attribute name="required">1</attribute>
</field>
</field>
</record>
<record id="res_users_view_form_profile" model="ir.ui.view">
<field name="name">res.users.preferences.form.inherit</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="res_users_view_form_simple_modif"/>
<field name="arch" type="xml">
<form position="attributes">
<attribute name="create">false</attribute>
<attribute name="js_class">hr_employee_profile_form</attribute>
</form>
<notebook position="replace">
<field name="hr_presence_state" invisible="1"/>
<header>
</header>
<sheet>$0</sheet>
</notebook>
<notebook position="before">
<div class="oe_button_box" name="button_box">
<button
id="hr_presence_button"
class="oe_stat_button"
disabled="1"
invisible="context.get('from_my_profile', False)"
attrs="{'invisible': [('hr_presence_state', '=', 'absent')]}">
<div role="img" class="fa fa-fw fa-circle text-success o_button_icon" attrs="{'invisible': [('hr_presence_state', '!=', 'present')]}" aria-label="Available" title="Available"/>
<div role="img" class="fa fa-fw fa-circle text-warning o_button_icon" attrs="{'invisible': [('hr_presence_state', '!=', 'to_define')]}" aria-label="Away" title="Away"/>
<div role="img" class="fa fa-fw fa-circle text-danger o_button_icon" attrs="{'invisible': [('hr_presence_state', '!=', 'absent')]}" aria-label="Not available" title="Not available"/>
<div class="o_stat_info" attrs="{'invisible': [('hr_presence_state', '=', 'present')]}">
<span class="o_stat_text">
Not Connected
</span>
</div>
<div class="o_stat_info" attrs="{'invisible': [('hr_presence_state', '!=', 'present')]}">
<span class="o_stat_value" attrs="{'invisible': [('last_activity_time', '=', False)]}">
<field name="last_activity_time"/>
</span>
<span class="o_stat_value" attrs="{'invisible': [('last_activity_time', '!=', False)]}">
<field name="last_activity"/>
</span>
<span class="o_stat_text">Connected Since</span>
</div>
</button>
</div>
<field name="image_1920" widget='image' class="oe_avatar" options='{"zoom": true, "preview_image":"image_128"}'/>
<div class="oe_title">
<h1>
<field name="name" placeholder="Employee's Name" required="True" readonly="context.get('from_my_profile', False)"/>
</h1>
</div>
<div class="row">
<h2 class="col-6">
<field name="job_title" placeholder="Job Position" attrs="{'readonly': [('can_edit', '=', False)]}"/>
</h2>
</div>
<group>
<group>
<field name="can_edit" invisible="1"/>
<field name="mobile_phone" widget="phone" attrs="{'readonly': [('can_edit', '=', False)]}" options="{'enable_sms': false}"/>
<field name="work_phone" widget="phone" attrs="{'readonly': [('can_edit', '=', False)]}" options="{'enable_sms': false}"/>
</group>
<group>
<field name="work_email" widget="email" attrs="{'readonly': [('can_edit', '=', False)]}"/>
<field name="work_location" attrs="{'readonly': [('can_edit', '=', False)]}"/>
<field name="company_id" invisible="1"/>
</group>
<group>
<field name="employee_parent_id" attrs="{'readonly': [('can_edit', '=', False)]}"/>
<field name="coach_id" attrs="{'readonly': [('can_edit', '=', False)]}"/>
</group>
</group>
</notebook>
<notebook position="inside">
<page name="public" string="Work Information">
<div id="o_work_employee_container"> <!-- These two div are used to position org_chart -->
<div id="o_work_employee_main">
<group string="Location">
<field name="department_id" attrs="{'readonly': [('can_edit', '=', False)]}"/>
<field name="address_id"
context="{'show_address': 1}"
options='{"always_reload": True, "highlight_first_line": True}'
attrs="{'readonly': [('can_edit', '=', False)]}"/>
</group>
<group name="managers" string="Approvers" class="hide-group-if-empty">
<!-- overridden in other modules -->
</group>
</div>
</div>
</page>
<page name="personal_information" string="Private Information">
<group>
<group string="Contact Information">
<field name="employee_ids" invisible="1"/>
<field name="address_home_id"
context="{
'show_address': 1,
'default_employee_ids': employee_ids,
'default_type': 'private',
'form_view_ref': 'base.res_partner_view_form_private'}"
options='{"always_reload": True, "highlight_first_line": True}'
attrs="{'readonly': [('can_edit', '=', False)]}"/>
<field name="private_email" string="Email" attrs="{'readonly': [('can_edit', '=', False)], 'invisible': [('address_home_id', '=', False)]}"/>
<field name="employee_phone" string="Phone" class="o_force_ltr" attrs="{'readonly': [('can_edit', '=', False)], 'invisible': [('address_home_id', '=', False)]}" options="{'enable_sms': false}"/>
<field name="employee_bank_account_id" attrs="{'readonly': [('can_edit', '=', False)]}"/>
<field name="km_home_work" attrs="{'readonly': [('can_edit', '=', False)]}"/>
</group>
<group string="Citizenship">
<field name="employee_country_id" options='{"no_open": True, "no_create": True}' attrs="{'readonly': [('can_edit', '=', False)]}"/>
<field name="identification_id" attrs="{'readonly': [('can_edit', '=', False)]}"/>
<field name="passport_id" attrs="{'readonly': [('can_edit', '=', False)]}"/>
<field name="gender" attrs="{'readonly': [('can_edit', '=', False)]}"/>
<field name="birthday" attrs="{'readonly': [('can_edit', '=', False)]}"/>
<field name="place_of_birth" attrs="{'readonly': [('can_edit', '=', False)]}"/>
<field name="country_of_birth" attrs="{'readonly': [('can_edit', '=', False)]}"/>
</group>
<group string="Marital Status">
<field name="marital" attrs="{'readonly': [('can_edit', '=', False)]}"/>
<field name="spouse_complete_name" attrs="{'invisible': [('marital', 'not in', ['married', 'cohabitant'])], 'readonly': [('can_edit', '=', False)]}"/>
<field name="spouse_birthdate" attrs="{'invisible': [('marital', 'not in', ['married', 'cohabitant'])], 'readonly': [('can_edit', '=', False)]}"/>
</group>
<group string="Education">
<field name="certificate" attrs="{'readonly': [('can_edit', '=', False)]}"/>
<field name="study_field" attrs="{'readonly': [('can_edit', '=', False)]}"/>
<field name="study_school" attrs="{'readonly': [('can_edit', '=', False)]}"/>
</group>
<group string="Dependant">
<field name="children" attrs="{'readonly': [('can_edit', '=', False)]}"/>
</group>
<group string="Emergency">
<field name="emergency_contact" attrs="{'readonly': [('can_edit', '=', False)]}"/>
<field name="emergency_phone" widget="phone" attrs="{'readonly': [('can_edit', '=', False)]}" options="{'enable_sms': false}"/>
</group>
<group string="Work Permit" name="work_permit">
<field name="visa_no" attrs="{'readonly': [('can_edit', '=', False)]}"/>
<field name="permit_no" attrs="{'readonly': [('can_edit', '=', False)]}"/>
<field name="visa_expire" attrs="{'readonly': [('can_edit', '=', False)]}"/>
</group>
</group>
</page>
<page name="hr_settings" string="HR Settings">
<group>
<group string='Status' name="active_group" invisible="1"></group>
<group string="Attendance" name="identification_group">
<field name="pin" attrs="{'readonly': [('can_edit', '=', False)]}"/>
<field name="barcode" attrs="{'readonly': [('can_edit', '=', False)]}"/>
</group>
</group>
</page>
</notebook>
</field>
</record>
<record id="res_users_action_my" model="ir.actions.act_window">
<field name="name">Change my Preferences</field>
<field name="res_model">res.users</field>
<field name="view_mode">form</field>
<field name="context">{'from_my_profile': True}</field>
<field name="view_id" ref="hr.res_users_view_form_profile"/>
</record>
<record id="hr_employee_action_from_user" model="ir.actions.act_window">
<field name="name">Employees</field>
<field name="res_model">hr.employee</field>
<field name="view_mode">kanban,tree,form</field>
<field name="domain">[('user_id', '=', active_id)]</field>
</record>
<record id="res_users_view_form" model="ir.ui.view">
<field name="name">res.users.form.inherit</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form"/>
<field name="arch" type="xml">
<xpath expr="//header" position="inside">
<field name="share" invisible="1"/>
<field name="employee_ids" invisible="1"/>
<field name="employee_id" invisible="1"/>
<button string="Create employee"
type="object" name="action_create_employee"
attrs="{'invisible': ['|', '|', ('id', '=', False), ('share', '=', True), ('employee_id', '!=', False)]}"/>
<!-- share is not correctly recomputed because it depends on fields of reified view => invisible before saving (id=False) -->
</xpath>
<xpath expr="//div[@name='button_box']" position="inside">
<button name="%(hr_employee_action_from_user)d"
class="oe_stat_button"
icon="fa-users"
attrs="{'invisible': [('employee_count', '=', 0)]}"
context="{'active_test': False}"
type="action">
<field name="employee_count" widget="statinfo" string="Employee(s)"/>
</button>
</xpath>
</field>
</record>
</data>
</odoo>
|