diff options
| author | Kevin Baptiste <kba@odoo.com> | 2019-08-08 09:06:22 +0000 |
|---|---|---|
| committer | Kevin Baptiste <kba@odoo.com> | 2019-08-13 13:00:40 +0000 |
| commit | f9fafcdcfbbb562d61ad85c99729d921be2aa98d (patch) | |
| tree | c9f627922209055f0304cead0923b08d4e0ddf63 | |
| parent | 39a0162b80fd9185f8d883de6c5a9343cec7c7e7 (diff) | |
[IMP] hr: improve employee profile usability (back2basics)
Improve the usability of the employees profile / "My Profile"
TaskID: 2048672
closes odoo/odoo#35587
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
| -rw-r--r-- | addons/hr/models/hr_employee.py | 4 | ||||
| -rw-r--r-- | addons/hr/views/hr_employee_views.xml | 15 | ||||
| -rw-r--r-- | addons/hr/views/res_users.xml | 38 | ||||
| -rw-r--r-- | addons/hr_attendance/views/hr_employee_view.xml | 13 | ||||
| -rw-r--r-- | addons/hr_holidays/views/hr_views.xml | 18 | ||||
| -rw-r--r-- | addons/im_livechat/views/res_users_views.xml | 8 | ||||
| -rw-r--r-- | addons/mail/views/res_users_views.xml | 3 | ||||
| -rw-r--r-- | addons/website_forum/views/res_users_views.xml | 16 | ||||
| -rw-r--r-- | odoo/addons/base/models/res_users.py | 2 | ||||
| -rw-r--r-- | odoo/addons/base/views/res_users_views.xml | 2 |
10 files changed, 51 insertions, 68 deletions
diff --git a/addons/hr/models/hr_employee.py b/addons/hr/models/hr_employee.py index e38d5b5a14e..df264e75078 100644 --- a/addons/hr/models/hr_employee.py +++ b/addons/hr/models/hr_employee.py @@ -35,7 +35,7 @@ class HrEmployeePrivate(models.Model): # resource and user # required on the resource, make sure required="True" set in the view - name = fields.Char(related='resource_id.name', store=True, readonly=False, tracking=True) + name = fields.Char(string="Employee Name", related='resource_id.name', store=True, readonly=False, tracking=True) user_id = fields.Many2one('res.users', 'User', related='resource_id.user_id', store=True, readonly=False) user_partner_id = fields.Many2one(related='user_id.partner_id', related_sudo=False, string="User's partner") active = fields.Boolean('Active', related='resource_id.active', default=True, store=True, readonly=False) @@ -101,7 +101,7 @@ class HrEmployeePrivate(models.Model): coach_id = fields.Many2one('hr.employee', 'Coach') category_ids = fields.Many2many( 'hr.employee.category', 'employee_category_rel', - 'emp_id', 'category_id', groups="hr.group_hr_user", + 'emp_id', 'category_id', groups="hr.group_hr_manager", string='Tags') # misc notes = fields.Text('Notes', groups="hr.group_hr_user") diff --git a/addons/hr/views/hr_employee_views.xml b/addons/hr/views/hr_employee_views.xml index 064758f6be2..cea424933b4 100644 --- a/addons/hr/views/hr_employee_views.xml +++ b/addons/hr/views/hr_employee_views.xml @@ -9,7 +9,7 @@ <search string="Employees"> <field name="name" string="Employees" filter_domain="['|',('work_email','ilike',self),('name','ilike',self)]"/> <field name="department_id" operator="child_of"/> - <field name="category_ids" groups="hr.group_hr_user"/> + <field name="category_ids" groups="hr.group_hr_manager"/> <field name="job_title" /> <field name="company_id" groups="base.group_multi_company"/> <filter string="Archived" name="inactive" domain="[('active','=',False)]"/> @@ -60,22 +60,21 @@ <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_value"> - <field name="last_activity"/> - </span> <span class="o_stat_text"> - Last Activity + Not Connected </span> </div> <div class="o_stat_info" attrs="{'invisible': [('hr_presence_state', '!=', 'present')]}"> - <span class="o_stat_text">Connected</span> + <span class="o_stat_value"> + <field name="last_activity"/> + </span> + <span class="o_stat_text">Connected Since</span> </div> </button> </div> <widget name="web_ribbon" text="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/> <field name="image_1920" widget='image' class="oe_avatar" options='{"zoom": true, "preview_image":"image_128"}'/> <div class="oe_title"> - <label for="name" class="oe_edit_only"/> <h1> <field name="name" placeholder="Employee's Name" required="True"/> </h1> @@ -252,7 +251,7 @@ <span t-if="record.job_title.raw_value" class="o_kanban_record_subtitle"><field name="job_title"/></span> </div> </div> - <field name="category_ids" widget="many2many_tags" options="{'color_field': 'color'}"/> + <field name="category_ids" widget="many2many_tags" options="{'color_field': 'color'}" groups="hr.group_hr_manager"/> <ul> <li id="last_login"/> <li t-if="record.work_email.raw_value"><field name="work_email" /></li> diff --git a/addons/hr/views/res_users.xml b/addons/hr/views/res_users.xml index 1f618fb776a..cab22bb0cf7 100644 --- a/addons/hr/views/res_users.xml +++ b/addons/hr/views/res_users.xml @@ -18,16 +18,16 @@ <xpath expr="//field[@name='email']" position="attributes"> <attribute name="invisible">1</attribute> </xpath> - <xpath expr="//group[@name='preferences']" position="before"> - <separator string="Email & Notifications" /> - </xpath> <field name="signature" position="replace" /> - <xpath expr="//field[@name='company_id']" position="after"> - <field name="signature" /> + <xpath expr="//group[@name='preference_contact']" position="before"> + <group> + <field name="signature" /> + </group> </xpath> <xpath expr="//field[@name='company_id']" position="attributes"> <attribute name="invisible">1</attribute> </xpath> + <button name="preference_change_password" position="replace"/> </field> </record> @@ -50,38 +50,39 @@ <form position="replace"> <form create="false" js_class="hr_employee_profile_form"> <field name="hr_presence_state" invisible="1"/> - <header></header> <!-- Used by other modules to add buttons --> + <header> + <button name="preference_change_password" type="object" string="Change password" class="btn btn-primary"/> + </header> <sheet> <div class="oe_button_box" name="button_box"> <button id="hr_presence_button" class="oe_stat_button" disabled="1" - attrs="{'invisible': [('hr_presence_state', '=', 'absent')]}"> + 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_value"> - <field name="last_activity"/> - </span> <span class="o_stat_text"> - Last Activity + Not Connected </span> </div> <div class="o_stat_info" attrs="{'invisible': [('hr_presence_state', '!=', 'present')]}"> - <span class="o_stat_text">Connected</span> + <span class="o_stat_value"> + <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"> - <label for="name" class="oe_edit_only"/> <h1> - <field name="name" placeholder="Employee's Name" required="True"/> + <field name="name" placeholder="Employee's Name" required="True" readonly="context.get('from_my_profile', False)"/> </h1> - <field name="category_ids" widget="many2many_tags" options="{'color_field': 'color', 'no_create_edit': True}" placeholder="Tags" groups="hr.group_hr_user"/> </div> <h2> <field name="job_title" placeholder="Job Position"/> @@ -90,12 +91,10 @@ <group> <field name="mobile_phone" widget="phone"/> <field name="work_phone" widget="phone"/> - <field name="work_email" widget="email"/> </group> <group> - <field name="department_id"/> + <field name="work_email" widget="email"/> <field name="company_id" invisible="1"/> - <field name="employee_parent_id"/> </group> </group> <notebook> @@ -106,12 +105,14 @@ <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"/> <field name="address_id" context="{'show_address': 1}" options='{"always_reload": True, "highlight_first_line": True}'/> <field name="work_location"/> </group> <group name="managers" string="Responsibles"> + <field name="employee_parent_id"/> <field name="coach_id"/> </group> </div> @@ -186,6 +187,7 @@ <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> diff --git a/addons/hr_attendance/views/hr_employee_view.xml b/addons/hr_attendance/views/hr_employee_view.xml index ac2abad8010..65a68bc63c9 100644 --- a/addons/hr_attendance/views/hr_employee_view.xml +++ b/addons/hr_attendance/views/hr_employee_view.xml @@ -25,11 +25,11 @@ <div role="img" id="oe_hr_attendance_status" class="fa fa-fw fa-circle o_button_icon oe_hr_attendance_status_green" attrs="{'invisible': [('attendance_state', '=', 'checked_out')]}" aria-label="Available" title="Available"/> <div role="img" id="oe_hr_attendance_status" class="fa fa-fw fa-circle o_button_icon oe_hr_attendance_status_red" attrs="{'invisible': [('attendance_state', '=', 'checked_in')]}" aria-label="Not available" title="Not available"/> <div class="o_stat_info" attrs="{'invisible': ['|', ('last_check_in', '=', False), ('last_check_out', '!=', False)]}"> - <span class="o_stat_text">Present Since</span> + <span class="o_stat_text">Attended Since</span> <span class="o_stat_value"><field name="last_check_in" widget="relative_time"/></span> </div> <div class="o_stat_info" attrs="{'invisible': [('last_check_out', '=', False)]}"> - <span class="o_stat_text">Absent Since</span> + <span class="o_stat_text">Not Attended Since</span> <span class="o_stat_value"><field name="last_check_out" widget="relative_time"/></span> </div> <div class="o_stat_info" attrs="{'invisible': [('last_check_in', '!=', False)]}"> @@ -37,8 +37,8 @@ </div> </button> <button name="%(hr_attendance_action)d" - class="fa-clock-o" - icon="fa-calendar" + class="oe_stat_button" + icon="fa-clock-o" type="action" context="{'search_default_employee_id': active_id, 'search_default_check_in_filter': '1'}" groups="base.group_user" @@ -71,15 +71,16 @@ <button name="%(hr_attendance_action_my_attendances)d" id="hr_attendance_button" class="oe_stat_button" + invisible="context.get('from_my_profile', False)" type="action" attrs="{'invisible': ['|', ('attendance_state', '=', False), '&', ('hr_presence_state', '=', 'present'), ('attendance_state', '=', 'checked_out')]}"> <div role="img" id="oe_hr_attendance_status" class="fa fa-fw fa-circle o_button_icon oe_hr_attendance_status_green" attrs="{'invisible': [('attendance_state', '=', 'checked_out')]}" aria-label="Available" title="Available"/> <div role="img" id="oe_hr_attendance_status" class="fa fa-fw fa-circle o_button_icon oe_hr_attendance_status_red" attrs="{'invisible': [('attendance_state', '=', 'checked_in')]}" aria-label="Not available" title="Not available"/> <div class="o_stat_info" attrs="{'invisible': ['|', ('last_check_in', '=', False), ('last_check_out', '!=', False)]}"> - <span class="o_stat_text">Present Since</span> + <span class="o_stat_text">Attended Since</span> <span class="o_stat_value"><field name="last_check_in" widget="relative_time"/></span> </div> <div class="o_stat_info" attrs="{'invisible': [('last_check_out', '=', False)]}"> - <span class="o_stat_text">Absent Since</span> + <span class="o_stat_text">Not Attended Since</span> <span class="o_stat_value"><field name="last_check_out" widget="relative_time"/></span> </div> <div class="o_stat_info" attrs="{'invisible': [('last_check_in', '!=', False)]}"> diff --git a/addons/hr_holidays/views/hr_views.xml b/addons/hr_holidays/views/hr_views.xml index 1b5d9dcd824..1b0048e0878 100644 --- a/addons/hr_holidays/views/hr_views.xml +++ b/addons/hr_holidays/views/hr_views.xml @@ -151,13 +151,13 @@ class="oe_stat_button" context="{'search_default_employee_id': active_id}" attrs="{'invisible': [('is_absent', '=', False)]}"> - <div role="img" class="fa fa-fw fa-plane o_button_icon text-danger" aria-label="Absent Until" title="Absent Until"/> + <div role="img" class="fa fa-fw fa-plane o_button_icon text-danger" aria-label="Off Till" title="Off Till"/> <div class="o_field_widget o_stat_info"> <span class="o_stat_value"> <field name="leave_date_to"/> </span> <span class="o_stat_text"> - Absent Until + Off Till </span> </div> </button> @@ -171,7 +171,7 @@ help="Remaining leaves"> <div class="o_field_widget o_stat_info"> <span class="o_stat_value"> - <field name="allocation_used_display"/>/<field name="allocation_display"/> + <field name="allocation_used_display"/>/<field name="allocation_display"/> Days </span> <span class="o_stat_text"> Time Off @@ -197,13 +197,13 @@ <button disabled="1" class="oe_stat_button" attrs="{'invisible': [('is_absent', '=', False)]}"> - <div role="img" class="fa fa-fw fa-plane o_button_icon text-warning" aria-label="Absent Until" title="Absent Until"/> + <div role="img" class="fa fa-fw fa-plane o_button_icon text-warning" aria-label="Off Till" title="Off Till"/> <div class="o_field_widget o_stat_info"> <span class="o_stat_value"> <field name="leave_date_to"/> </span> <span class="o_stat_text"> - Absent Until + Off Till </span> </div> </button> @@ -237,14 +237,15 @@ <field name="is_absent" invisible="1"/> <button name="%(hr_leave_action_new_request)d" type="action" class="oe_stat_button" + invisible="context.get('from_my_profile', False)" attrs="{'invisible': [('is_absent', '=', False)]}"> - <div role="img" class="fa fa-fw fa-plane o_button_icon text-danger" aria-label="Absent Until" title="Absent Until"/> + <div role="img" class="fa fa-fw fa-plane o_button_icon text-danger" aria-label="Off Till" title="Off Till"/> <div class="o_field_widget o_stat_info"> <span class="o_stat_value"> <field name="leave_date_to"/> </span> <span class="o_stat_text"> - Absent Until + Off Till </span> </div> </button> @@ -257,8 +258,7 @@ help="Remaining leaves"> <div class="o_field_widget o_stat_info"> <span class="o_stat_value"> - <field name="allocation_used_display"/>/ - <field name="allocation_display"/> + <field name="allocation_used_display"/>/<field name="allocation_display"/> Days </span> <span class="o_stat_text"> Time Off diff --git a/addons/im_livechat/views/res_users_views.xml b/addons/im_livechat/views/res_users_views.xml index e2342ffe17c..0ded2190802 100644 --- a/addons/im_livechat/views/res_users_views.xml +++ b/addons/im_livechat/views/res_users_views.xml @@ -8,9 +8,9 @@ <field name="model">res.users</field> <field name="inherit_id" ref="base.view_users_form_simple_modif"/> <field name="arch" type="xml"> - <field name="out_of_office_message" position="after"> - <field name="livechat_username" string="Online Chat Username" readonly="0"/> - </field> + <xpath expr="//field[@name='tz']" position="after"> + <field name="livechat_username" string="Online Chat Name" readonly="0"/> + </xpath> </field> </record> @@ -20,7 +20,7 @@ <field name="model">res.users</field> <field name="inherit_id" ref="base.view_users_form"/> <field name="arch" type="xml"> - <xpath expr="//group[@name='messaging']" position="inside"> + <xpath expr="//group[@name='messaging']" position="after"> <group name="livechat" string="Livechat"> <field name="livechat_username"/> </group> diff --git a/addons/mail/views/res_users_views.xml b/addons/mail/views/res_users_views.xml index d1fcc5e4ef7..c2d3d9ce825 100644 --- a/addons/mail/views/res_users_views.xml +++ b/addons/mail/views/res_users_views.xml @@ -12,9 +12,6 @@ <field name="email" position="before"> <field name="notification_type" widget="radio" readonly="0"/> </field> - <xpath expr="//group[@name='status']" position="inside"> - <field name="out_of_office_message" readonly="0"/> - </xpath> </data> </field> </record> diff --git a/addons/website_forum/views/res_users_views.xml b/addons/website_forum/views/res_users_views.xml index 8d826869ed2..9d3a19f6622 100644 --- a/addons/website_forum/views/res_users_views.xml +++ b/addons/website_forum/views/res_users_views.xml @@ -8,27 +8,11 @@ <field name="model">res.users</field> <field name="inherit_id" ref="base.view_users_form"/> <field name="arch" type="xml"> - <field name="company_id" position="before"> - <field name="karma" string="Forum Karma"/> - </field> <div name="button_box" position="inside"> <field name="is_published" widget="website_redirect_button"/> </div> </field> </record> - <record id="res_users_view_form_preference" model="ir.ui.view"> - <field name="name">res.users.form.preference.forum</field> - <field name="model">res.users</field> - <field name="inherit_id" ref="base.view_users_form_simple_modif"/> - <field name="arch" type="xml"> - <data> - <field name="company_id" position="before"> - <field name="karma" string="Forum Karma" readonly="1"/> - </field> - </data> - </field> - </record> - </data> </odoo> diff --git a/odoo/addons/base/models/res_users.py b/odoo/addons/base/models/res_users.py index 7606124f223..b42dadb2664 100644 --- a/odoo/addons/base/models/res_users.py +++ b/odoo/addons/base/models/res_users.py @@ -224,7 +224,7 @@ class Users(models.Model): help="Specify a value only when creating a user or if you're "\ "changing the user's password, otherwise leave empty. After "\ "a change of password, the user has to login again.") - signature = fields.Html() + signature = fields.Html(string="Email Signature") active = fields.Boolean(default=True) active_partner = fields.Boolean(related='partner_id.active', readonly=True, string="Partner is Active") action_id = fields.Many2one('ir.actions.actions', string='Home Action', diff --git a/odoo/addons/base/views/res_users_views.xml b/odoo/addons/base/views/res_users_views.xml index c6d078b1d2c..d85f0245839 100644 --- a/odoo/addons/base/views/res_users_views.xml +++ b/odoo/addons/base/views/res_users_views.xml @@ -231,7 +231,7 @@ <field name="action_id"/> </group> </group> - <group string="Messaging and Social" name="messaging"> + <group name="messaging"> <field name="signature"/> </group> </page> |
