diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
| commit | 3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch) | |
| tree | a44932296ef4a9b71d5f010906253d8c53727726 /addons/hr/views | |
| parent | 0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff) | |
initial commit 2
Diffstat (limited to 'addons/hr/views')
| -rw-r--r-- | addons/hr/views/hr_department_views.xml | 133 | ||||
| -rw-r--r-- | addons/hr/views/hr_employee_category_views.xml | 37 | ||||
| -rw-r--r-- | addons/hr/views/hr_employee_public_views.xml | 206 | ||||
| -rw-r--r-- | addons/hr/views/hr_employee_views.xml | 402 | ||||
| -rw-r--r-- | addons/hr/views/hr_job_views.xml | 129 | ||||
| -rw-r--r-- | addons/hr/views/hr_plan_views.xml | 100 | ||||
| -rw-r--r-- | addons/hr/views/hr_templates.xml | 29 | ||||
| -rw-r--r-- | addons/hr/views/hr_views.xml | 117 | ||||
| -rw-r--r-- | addons/hr/views/mail_channel_views.xml | 14 | ||||
| -rw-r--r-- | addons/hr/views/res_config_settings_views.xml | 126 | ||||
| -rw-r--r-- | addons/hr/views/res_users.xml | 229 |
11 files changed, 1522 insertions, 0 deletions
diff --git a/addons/hr/views/hr_department_views.xml b/addons/hr/views/hr_department_views.xml new file mode 100644 index 00000000..f9c7b891 --- /dev/null +++ b/addons/hr/views/hr_department_views.xml @@ -0,0 +1,133 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <data> + <record id="view_department_form" model="ir.ui.view"> + <field name="name">hr.department.form</field> + <field name="model">hr.department</field> + <field name="arch" type="xml"> + <form string="department"> + <sheet> + <widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/> + <field name="active" invisible="1"/> + <group col="4"> + <field name="name"/> + <field name="manager_id"/> + <field name="parent_id"/> + <field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/> + </group> + </sheet> + <div class="oe_chatter"> + <field name="message_follower_ids" groups="base.group_user"/> + <field name="message_ids"/> + </div> + </form> + </field> + </record> + + <record id="view_department_tree" model="ir.ui.view"> + <field name="name">hr.department.tree</field> + <field name="model">hr.department</field> + <field name="arch" type="xml"> + <tree string="Companies" sample="1"> + <field name="display_name"/> + <field name="company_id" groups="base.group_multi_company"/> + <field name="manager_id"/> + <field name="parent_id"/> + </tree> + </field> + </record> + + <record id="view_department_filter" model="ir.ui.view"> + <field name="name">hr.department.search</field> + <field name="model">hr.department</field> + <field name="arch" type="xml"> + <search string="Departments"> + <field name="name" string="Department"/> + <field name="manager_id" /> + <filter string="Unread Messages" name="message_needaction" domain="[('message_needaction','=',True)]"/> + <separator/> + <filter string="Archived" name="inactive" domain="[('active','=',False)]"/> + </search> + </field> + </record> + + <record id="hr_department_view_kanban" model="ir.ui.view" > + <field name="name">hr.department.kanban</field> + <field name="model">hr.department</field> + <field name="arch" type="xml"> + <kanban class="oe_background_grey o_kanban_dashboard o_hr_kanban" sample="1"> + <field name="name"/> + <field name="company_id"/> + <field name="manager_id"/> + <field name="color"/> + <templates> + <t t-name="kanban-box"> + <div t-attf-class="#{!selection_mode ? kanban_color(record.color.raw_value) : ''}"> + <div t-attf-class="o_kanban_card_header"> + <div class="o_kanban_card_header_title"> + <div class="o_primary"><field name="name"/></div> + <div class="o_secondary"><field name="company_id" groups="base.group_multi_company"/></div> + </div> + <div class="o_kanban_manage_button_section" t-if="!selection_mode"> + <a class="o_kanban_manage_toggle_button" href="#"><i class="fa fa-ellipsis-v" role="img" aria-label="Manage" title="Manage"/></a> + </div> + </div> + <div class="container o_kanban_card_content" t-if="!selection_mode"> + <div class="row o_kanban_card_upper_content"> + <div class="col-4 o_kanban_primary_left"> + <button class="btn btn-primary" name="%(act_employee_from_department)d" type="action">Employees</button> + </div> + <div class="col-8 o_kanban_primary_right"> + </div> + </div> + </div> + <div class="o_kanban_card_manage_pane dropdown-menu" role="menu"> + <div class="o_kanban_card_manage_section"> + <div role="menuitem" class="o_kanban_card_manage_section o_kanban_manage_reports"> + <div class="o_kanban_card_manage_title"> + <strong><span>Reporting</span></strong> + </div> + </div> + </div> + <a t-if="widget.editable" role="menuitem" class="dropdown-item" type="edit">Configuration</a> + <ul t-if="widget.editable" class="oe_kanban_colorpicker" data-field="color" role="menu"/> + </div> + </div> + </t> + </templates> + </kanban> + </field> + </record> + + <record id="hr_department_kanban_action" model="ir.actions.act_window"> + <field name="name">Departments</field> + <field name="res_model">hr.department</field> + <field name="view_mode">kanban,tree,form</field> + <field name="search_view_id" ref="view_department_filter"/> + <field name="help" type="html"> + <p class="o_view_nocontent_smiling_face"> + Create a new department + </p><p> + Odoo's department structure is used to manage all documents + related to employees by departments: expenses, timesheets, + time off, recruitments, etc. + </p> + </field> + </record> + <record id="hr_department_tree_action" model="ir.actions.act_window"> + <field name="name">Departments</field> + <field name="res_model">hr.department</field> + <field name="view_mode">tree,form,kanban</field> + <field name="search_view_id" ref="view_department_filter"/> + <field name="help" type="html"> + <p class="o_view_nocontent_smiling_face"> + Create a new department + </p><p> + Odoo's department structure is used to manage all documents + related to employees by departments: expenses, timesheets, + leaves, recruitments, etc. + </p> + </field> + </record> + </data> +</odoo> diff --git a/addons/hr/views/hr_employee_category_views.xml b/addons/hr/views/hr_employee_category_views.xml new file mode 100644 index 00000000..f7a52d99 --- /dev/null +++ b/addons/hr/views/hr_employee_category_views.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <data> + + <record id="view_employee_category_form" model="ir.ui.view"> + <field name="name">hr.employee.category.form</field> + <field name="model">hr.employee.category</field> + <field name="arch" type="xml"> + <form string="Employee Tags"> + <sheet> + <group> + <field name="name"/> + </group> + </sheet> + </form> + </field> + </record> + + <record id="view_employee_category_list" model="ir.ui.view"> + <field name="name">hr.employee.category.list</field> + <field name="model">hr.employee.category</field> + <field eval="8" name="priority"/> + <field name="arch" type="xml"> + <tree string="Employees Tags" editable="bottom"> + <field name="name"/> + </tree> + </field> + </record> + + <record id="open_view_categ_form" model="ir.actions.act_window"> + <field name="name">Employee Tags</field> + <field name="res_model">hr.employee.category</field> + <field name="view_mode">tree,form</field> + </record> + + </data> + </odoo> diff --git a/addons/hr/views/hr_employee_public_views.xml b/addons/hr/views/hr_employee_public_views.xml new file mode 100644 index 00000000..703e2ebc --- /dev/null +++ b/addons/hr/views/hr_employee_public_views.xml @@ -0,0 +1,206 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <data> + + <record id="hr_employee_public_view_search" model="ir.ui.view"> + <field name="name">hr.employee.search</field> + <field name="model">hr.employee.public</field> + <field name="arch" type="xml"> + <search string="Employees"> + <field name="name" string="Employees" filter_domain="['|',('work_email','ilike',self),('name','ilike',self)]"/> + <field name="job_title" string="Job Title"/> + <field name="department_id" string="Department"/> + <field name="company_id" string="Company"/> + <separator/> + <filter name="archived" string="Archived" domain="[('active', '=', False)]"/> + <group expand="0" string="Group By"> + <filter name="group_manager" string="Manager" domain="[]" context="{'group_by':'parent_id'}"/> + <filter name="group_department" string="Department" domain="[]" context="{'group_by':'department_id'}"/> + <filter name="group_company" string="Company" domain="[]" context="{'group_by':'company_id'}"/> + </group> + <searchpanel> + <field name="company_id" groups="base.group_multi_company" icon="fa-building" enable_counters="1"/> + <field name="department_id" icon="fa-users" enable_counters="1"/> + </searchpanel> + </search> + </field> + </record> + + <record id="hr_employee_public_view_form" model="ir.ui.view"> + <field name="name">hr.employee.public.form</field> + <field name="model">hr.employee.public</field> + <field name="arch" type="xml"> + <form string="Employee" create="0" write="0" js_class="hr_employee_form"> + <header/> + <sheet> + <field name="user_id" invisible="1"/> + <field name="user_partner_id" invisible="1"/> + <field name="active" invisible="1"/> + <div class="oe_button_box" name="button_box"> + <!-- Used by other modules--> + </div> + <widget name="web_ribbon" title="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"/> + <a title="Chat" icon="fa-comments" href="#" class="ml8 o_employee_chat_btn" invisible="not context.get('chat_icon')" attrs="{'invisible': [('user_id','=', False)]}" role="button"><i class="fa fa-comments"/></a> + </h1> + <h2> + <field name="job_title" placeholder="Job Title" /> + </h2> + </div> + <group> + <group> + <field name="mobile_phone" widget="phone" options="{'enable_sms': false}"/> + <field name="work_phone" widget="phone" options="{'enable_sms': false}"/> + <field name="work_email" widget="email"/> + <field name="work_location"/> + </group> + <group> + <field name="department_id"/> + <field name="company_id" groups="base.group_multi_company"/> + <field name="parent_id"/> + <field name="coach_id"/> + </group> + </group> + <notebook> + <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="address_id" + context="{'show_address': 1}" + options='{"always_reload": True, "highlight_first_line": True}'/> + </group> + <group name="managers" string="Approvers" invisible="1"> + <!-- overridden in other modules --> + </group> + <group string="Schedule" groups="base.group_no_one"> + <field name="resource_calendar_id"/> + </group> + </div> + </div> + </page> + </notebook> + </sheet> + </form> + </field> + </record> + + <record id="hr_employee_public_view_tree" model="ir.ui.view"> + <field name="name">hr.employee.tree</field> + <field name="model">hr.employee.public</field> + <field name="arch" type="xml"> + <tree string="Employees" sample="1"> + <field name="name"/> + <field name="work_phone" class="o_force_ltr"/> + <field name="work_email"/> + <field name="company_id" groups="base.group_multi_company"/> + <field name="department_id"/> + <field name="job_title"/> + <field name="parent_id"/> + <field name="coach_id" invisible="1"/> + </tree> + </field> + </record> + + <record id="hr_employee_public_view_kanban" model="ir.ui.view"> + <field name="name">hr.employee.kanban</field> + <field name="model">hr.employee.public</field> + <field name="priority">10</field> + <field name="arch" type="xml"> + <kanban class="o_hr_employee_kanban" js_class="hr_employee_kanban" sample="1"> + <field name="id"/> + <field name="hr_presence_state"/> + <field name="user_id"/> + <field name="user_partner_id"/> + <field name="last_activity"/> + <field name="hr_icon_display"/> + <templates> + <t t-name="kanban-box"> + <div class="oe_kanban_global_click o_kanban_record_has_image_fill o_hr_kanban_record"> + <field name="image_128" widget="image" class="o_kanban_image_fill_left" options="{'zoom': true, 'zoom_delay': 1000, 'background': true, 'preventClicks': false}"/> + + <div class="oe_kanban_details"> + <div class="o_kanban_record_top"> + <div class="o_kanban_record_headings"> + <strong class="o_kanban_record_title"> + <div class="float-right" + t-if="record.hr_icon_display.raw_value == 'presence_present'"> + <!-- Employee is present/connected and it is normal according to his work schedule --> + <span class="fa fa-circle text-success" role="img" aria-label="Present" + title="Present" name="presence_present"> + </span> + </div> + <div class="float-right" + t-if="record.hr_icon_display.raw_value == 'presence_absent'"> + <!-- Employee is absent and it is normal according to his work schedule --> + <span class="fa fa-circle-o text-muted" role="img" aria-label="Absent" + title="Absent" name="presence_absent"> + </span> + </div> + <div class="float-right" + t-if="record.hr_icon_display.raw_value == 'presence_absent_active'"> + <!-- Employee is connected but according to his work schedule, he should not work for now --> + <span class="fa fa-circle-o text-success" role="img" + aria-label="Present but not active" + title="Present but not active" name="presence_absent_active"> + </span> + </div> + <!-- Employee is not here but according to his work schedule, he should be connected --> + <div class="float-right" + t-if="record.hr_icon_display.raw_value == 'presence_to_define'"> + <span class="fa fa-circle text-warning" role="img" + aria-label="To define" title="To define" + name="presence_to_define"> + </span> + </div> + <field name="name"/> + </strong> + <span t-if="record.job_title.raw_value" class="o_kanban_record_subtitle"><field name="job_title"/></span> + </div> + </div> + <ul> + <li id="last_login"/> + <li t-if="record.work_email.raw_value"><field name="work_email" /></li> + <li t-if="record.work_phone.raw_value" class="o_force_ltr"><field name="work_phone" /></li> + </ul> + <div class="oe_kanban_content"> + <div class="o_kanban_record_bottom"> + <div class="oe_kanban_bottom_left"/> + <div class="oe_kanban_bottom_right"> + <a title="Chat" icon="fa-comments" href="#" class="ml8 o_employee_chat_btn" attrs="{'invisible': [('user_id','=', False)]}" role="button"><i class="fa fa-comments"/></a> + </div> + </div> + </div> + </div> + </div> + </t> + </templates> + </kanban> + </field> + </record> + + <record id="hr_employee_public_action" model="ir.actions.act_window"> + <field name="name">Employees</field> + <field name="res_model">hr.employee.public</field> + <field name="view_mode">kanban,tree,form</field> + <field name="domain">[]</field> + <field name="context">{}</field> + <field name="view_id" eval="False"/> + <field name="search_view_id" ref="hr_employee_public_view_search"/> + <field name="help" type="html"> + <p class="o_view_nocontent_smiling_face"> + Add a new employee + </p><p> + With just a quick glance on the Odoo employee screen, you + can easily find all the information you need for each person; + contact data, job position, availability, etc. + </p> + </field> + </record> + + </data> +</odoo> diff --git a/addons/hr/views/hr_employee_views.xml b/addons/hr/views/hr_employee_views.xml new file mode 100644 index 00000000..c0d4dcd2 --- /dev/null +++ b/addons/hr/views/hr_employee_views.xml @@ -0,0 +1,402 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <data> + + <record id="view_employee_filter" model="ir.ui.view"> + <field name="name">hr.employee.search</field> + <field name="model">hr.employee</field> + <field name="arch" type="xml"> + <search string="Employees"> + <field name="name" string="Employee" filter_domain="['|', ('work_email', 'ilike', self), ('name', 'ilike', self)]"/> + <field name="category_ids" groups="hr.group_hr_user"/> + <field name="job_id"/> + <separator/> + <filter string="Unread Messages" name="message_needaction" domain="[('message_needaction', '=', True)]"/> + <separator/> + <filter invisible="1" string="Late Activities" name="activities_overdue" + domain="[('my_activity_date_deadline', '<', context_today().strftime('%Y-%m-%d'))]"/> + <filter invisible="1" string="Today Activities" name="activities_today" + domain="[('my_activity_date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/> + <filter invisible="1" string="Future Activities" name="activities_upcoming_all" + domain="[('my_activity_date_deadline', '>', context_today().strftime('%Y-%m-%d'))]"/> + <separator/> + <filter string="Archived" name="inactive" domain="[('active', '=', False)]"/> + <group expand="0" string="Group By"> + <filter name="group_manager" string="Manager" domain="[]" context="{'group_by': 'parent_id'}"/> + <filter name="group_department" string="Department" domain="[]" context="{'group_by': 'department_id'}"/> + <filter name="group_job" string="Job" domain="[]" context="{'group_by': 'job_id'}"/> + </group> + <searchpanel> + <field name="company_id" groups="base.group_multi_company" icon="fa-building" enable_counters="1"/> + <field name="department_id" icon="fa-users" enable_counters="1"/> + </searchpanel> + </search> + </field> + </record> + + <record id="view_employee_form" model="ir.ui.view"> + <field name="name">hr.employee.form</field> + <field name="model">hr.employee</field> + <field name="arch" type="xml"> + <form string="Employee" js_class="hr_employee_form" class='o_employee_form'> + <field name="active" invisible="1"/> + <field name="user_partner_id" invisible="1"/> + <field name="hr_presence_state" invisible="1"/> + <header> + <button name="%(plan_wizard_action)d" string="Launch Plan" type="action" groups="hr.group_hr_manager"/> + </header> + <sheet> + <div name="button_box" class="oe_button_box"> + <button + id="hr_presence_button" + class="oe_stat_button" + disabled="1" + attrs="{'invisible': ['|', ('last_activity', '=', False), ('user_id', '=', False)]}"> + <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">Present Since</span> + </div> + </button> + </div> + <widget name="web_ribbon" title="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"> + <h1 class="d-flex"> + <field name="name" placeholder="Employee's Name" required="True"/> + <a title="Chat" icon="fa-comments" href="#" class="ml8 o_employee_chat_btn" invisible="not context.get('chat_icon')" attrs="{'invisible': [('user_id','=', False)]}" role="button"><i class="fa fa-comments"/></a> + </h1> + <h2> + <field name="job_title" placeholder="Job Position" /> + </h2> + <field name="category_ids" widget="many2many_tags" options="{'color_field': 'color', 'no_create_edit': True}" placeholder="Tags" groups="hr.group_hr_manager"/> + </div> + <group> + <group> + <field name="mobile_phone" widget="phone"/> + <field name="work_phone" widget="phone"/> + <field name="work_email" widget="email"/> + <field name="company_id" groups="base.group_multi_company"/> + </group> + <group> + <field name="department_id"/> + <field name="parent_id"/> + <field name="coach_id"/> + </group> + </group> + <notebook> + <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="address_id" + context="{'show_address': 1}" + options='{"always_reload": True, "highlight_first_line": True}'/> + <field name="work_location"/> + </group> + <group name="managers" string="Approvers" class="hide-group-if-empty"> + <!-- is overridden in other hr related modules --> + </group> + <group name="departure" string="Departure" attrs="{'invisible': [('active', '=', True)]}"> + <field name="departure_reason"/> + <field name="departure_description"/> + <field name="departure_date"/> + </group> + <group string="Schedule"> + <field name="resource_calendar_id" required="1"/> + <field name="tz"/> + </group> + </div> + </div> + </page> + <page name="personal_information" string="Private Information" groups="hr.group_hr_user"> + <group> + <group string="Private Contact"> + <field name="address_home_id" + context="{ + 'show_address': 1, + 'default_type': 'private', + 'form_view_ref': 'base.res_partner_view_form_private'}" + options='{"always_reload": True, "highlight_first_line": True}'/> + <field name="private_email" string="Email"/> + <field name="phone" class="o_force_ltr" groups="hr.group_hr_user" string="Phone" readonly="True"/> + <field name="bank_account_id" context="{'default_partner_id': address_home_id}"/> + <label for="km_home_work"/> + <div class="o_row" name="div_km_home_work"> + <field name="km_home_work" groups="hr.group_hr_user"/> + <span>Km</span> + </div> + + </group> + <group string="Citizenship"> + <field name="country_id" options='{"no_open": True, "no_create": True}'/> + <field name="identification_id" groups="hr.group_hr_user"/> + <field name="passport_id" groups="hr.group_hr_user"/> + <field name="gender"/> + <field name="birthday"/> + <field name="place_of_birth" groups="hr.group_hr_user"/> + <field name="country_of_birth" groups="hr.group_hr_user"/> + </group> + <group string="Marital Status"> + <field name="marital"/> + <field name="spouse_complete_name" attrs="{'invisible': [('marital', 'not in', ['married', 'cohabitant'])]}" groups="hr.group_hr_user"/> + <field name="spouse_birthdate" attrs="{'invisible': [('marital', 'not in', ['married', 'cohabitant'])]}" groups="hr.group_hr_user"/> + </group> + <group string="Dependant"> + <field name="children"/> + </group> + <group string="Emergency"> + <field name="emergency_contact"/> + <field name="emergency_phone" class="o_force_ltr"/> + </group> + <group string="Work Permit" name="work_permit"> + <field name="visa_no"/> + <field name="permit_no"/> + <field name="visa_expire"/> + </group> + <group string="Education"> + <field name="certificate"/> + <field name="study_field"/> + <field name="study_school"/> + </group> + </group> + </page> + <page name="hr_settings" string="HR Settings" groups="hr.group_hr_user"> + <group> + <group string='Status' name="active_group"> + <field name="user_id" string="Related User" domain="[('share', '=', False)]"/> + <field name="job_id"/> + </group> + <group string="Attendance" name="identification_group"> + <field name="pin" string="PIN Code"/> + <label for="barcode"/> + <div class="o_row"> + <field name="barcode"/> + <button string="Generate" class="btn btn-link" type="object" name="generate_random_barcode" attrs="{'invisible': [('barcode', '!=', False)]}"/> + <button name="%(hr_employee_print_badge)d" string="Print Badge" class="btn btn-link" type="action" attrs="{'invisible': [('barcode', '=', False)]}"/> + </div> + </group> + </group> + </page> + </notebook> + + </sheet> + <div class="oe_chatter"> + <field name="message_follower_ids" groups="base.group_user"/> + <field name="activity_ids"/> + <field name="message_ids"/> + </div> + </form> + </field> + </record> + + <record id="view_employee_tree" model="ir.ui.view"> + <field name="name">hr.employee.tree</field> + <field name="model">hr.employee</field> + <field name="arch" type="xml"> + <tree string="Employees" multi_edit="1" sample="1"> + <field name="name" readonly="1"/> + <field name="work_phone" class="o_force_ltr" readonly="1"/> + <field name="work_email"/> + <field name="company_id" groups="base.group_multi_company" readonly="1"/> + <field name="department_id"/> + <field name="job_id"/> + <field name="parent_id"/> + <field name="work_location" optional="hide"/> + <field name="coach_id" invisible="1"/> + </tree> + </field> + </record> + + <record id="hr_kanban_view_employees" model="ir.ui.view"> + <field name="name">hr.employee.kanban</field> + <field name="model">hr.employee</field> + <field name="priority">10</field> + <field name="arch" type="xml"> + <kanban class="o_hr_employee_kanban" js_class="hr_employee_kanban" sample="1"> + <field name="id"/> + <field name="hr_presence_state"/> + <field name="user_id"/> + <field name="user_partner_id"/> + <field name="hr_icon_display"/> + <templates> + <t t-name="kanban-box"> + <div class="oe_kanban_global_click o_kanban_record_has_image_fill o_hr_kanban_record"> + <field name="image_128" widget="image" class="o_kanban_image_fill_left" options="{'zoom': true, 'zoom_delay': 1000, 'background': true, 'preventClicks': false}"/> + + <div class="oe_kanban_details"> + <div class="o_kanban_record_top"> + <div class="o_kanban_record_headings"> + <strong class="o_kanban_record_title"> + <div class="float-right" + t-if="record.hr_icon_display.raw_value == 'presence_present'" + name="presence_present"> + <!-- Employee is present/connected and it is normal according to his work schedule --> + <span class="fa fa-circle text-success" role="img" aria-label="Present" + title="Present" name="presence_present"> + </span> + </div> + <div class="float-right" + t-if="record.hr_icon_display.raw_value == 'presence_absent'" + name="presence_absent"> + <!-- Employee is not present and it is normal according to his work schedule --> + <span class="fa fa-circle-o text-muted" role="img" aria-label="Absent" + title="Absent" name="presence_absent"> + </span> + </div> + <div class="float-right" + t-if="record.hr_icon_display.raw_value == 'presence_absent_active'" + name="presence_absent_active"> + <!-- Employee is connected but according to his work schedule, + he should not work for now --> + <span class="fa fa-circle-o text-success" role="img" + aria-label="Present but not active" + title="Present but not active" + name="presence_absent_active"> + </span> + </div> + <div class="float-right" + t-if="record.hr_icon_display.raw_value == 'presence_to_define'" + name="presence_to_define"> + <!-- Employee is not here but according to his work schedule, he should be connected --> + <span class="fa fa-circle text-warning" role="img" + aria-label="To define" title="To define" + name="presence_to_define"> + </span> + </div> + <field name="name" placeholder="Employee's Name"/> + </strong> + <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'}" groups="hr.group_hr_manager"/> + <ul> + <li id="last_login"/> + <li t-if="record.work_email.raw_value" class="o_text_overflow"><field name="work_email" /></li> + <li t-if="record.work_phone.raw_value" class="o_force_ltr"><field name="work_phone" /></li> + </ul> + <div class="oe_kanban_content"> + <div class="o_kanban_record_bottom"> + <div class="oe_kanban_bottom_left"/> + <div class="oe_kanban_bottom_right"> + <a title="Chat" icon="fa-comments" href="#" class="ml8 o_employee_chat_btn" attrs="{'invisible': [('user_id','=', False)]}" role="button"><i class="fa fa-comments"/></a> + </div> + </div> + </div> + </div> + </div> + </t> + </templates> + </kanban> + </field> + </record> + + <record id="hr_employee_view_activity" model="ir.ui.view"> + <field name="name">hr.employee.activity</field> + <field name="model">hr.employee</field> + <field name="arch" type="xml"> + <activity string="Employees"> + <field name="id"/> + <templates> + <div t-name="activity-box"> + <img t-att-src="activity_image('hr.employee', 'image_128', record.id.raw_value)" role="img" t-att-title="record.id.value" t-att-alt="record.id.value"/> + <div> + <field name="name" display="full"/> + <field name="job_id" muted="1" display="full"/> + </div> + </div> + </templates> + </activity> + </field> + </record> + + <record id="open_view_employee_list_my" model="ir.actions.act_window"> + <field name="name">Employees</field> + <field name="res_model">hr.employee</field> + <field name="view_mode">kanban,tree,form,activity</field> + <field name="domain">[]</field> + <field name="context">{'chat_icon': True}</field> + <field name="view_id" eval="False"/> + <field name="search_view_id" ref="view_employee_filter"/> + <field name="help" type="html"> + <p class="o_view_nocontent_smiling_face"> + Add a new employee + </p><p> + With just a quick glance on the Odoo employee screen, you + can easily find all the information you need for each person; + contact data, job position, availability, etc. + </p> + </field> + </record> + + <record id="open_view_employee_tree" model="ir.actions.act_window"> + <field name="name">Employees Structure</field> + <field name="res_model">hr.employee</field> + <field name="view_mode">tree,form</field> + <field name="view_id" ref="view_employee_tree"/> + <field name="domain">[('parent_id','=',False)]</field> + <field name="search_view_id" ref="view_employee_filter"/> + </record> + + <record id="open_view_employee_list" model="ir.actions.act_window"> + <field name="name">Employees</field> + <field name="res_model">hr.employee</field> + <field name="view_mode">form,tree</field> + <field name="view_id" eval="False"/> + <field name="search_view_id" ref="view_employee_filter"/> + </record> + + <!-- Employee tree by manager --> + <record id="view_partner_tree2" model="ir.ui.view"> + <field name="name">hr.employee.tree</field> + <field name="model">hr.employee</field> + <field name="priority" eval="20"/> + <field name="arch" type="xml"> + <tree string="Employees"> + <field name="name"/> + <field name="work_phone" class="o_force_ltr"/> + <field name="work_email"/> + <field name="company_id" groups="base.group_multi_company"/> + <field name="department_id"/> + <field name="job_id"/> + <field name="coach_id" invisible="1"/> + <field name="parent_id" invisible="1"/> + </tree> + </field> + </record> + + <record id="act_employee_from_department" model="ir.actions.act_window"> + <field name="name">Employees</field> + <field name="res_model">hr.employee</field> + <field name="view_mode">kanban,form,tree</field> + <field name="search_view_id" ref="view_employee_filter"/> + <field name="context">{ + "searchpanel_default_department_id": active_id, + "default_department_id": active_id} + </field> + <field name="help" type="html"> + <p class="o_view_nocontent_smiling_face"> + Add a new employee + </p><p> + With just a quick glance on the Odoo employee screen, you + can easily find all the information you need for each person; + contact data, job position, availability, etc. + </p> + </field> + </record> + + </data> +</odoo> diff --git a/addons/hr/views/hr_job_views.xml b/addons/hr/views/hr_job_views.xml new file mode 100644 index 00000000..a97ec87c --- /dev/null +++ b/addons/hr/views/hr_job_views.xml @@ -0,0 +1,129 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <data> + + <record id="view_hr_job_form" model="ir.ui.view"> + <field name="name">hr.job.form</field> + <field name="model">hr.job</field> + <field name="arch" type="xml"> + <form string="Job"> + <header> + <button name="set_recruit" string="Start Recruitment" states="open" type="object" class="oe_highlight" groups="base.group_user"/> + <button name="set_open" string="Stop Recruitment" states="recruit" type="object" groups="base.group_user"/> + <field name="state" widget="statusbar" statusbar_visible="recruit,open"/> + </header> + <sheet> + <div class="oe_button_box" name="button_box"/> + <div class="oe_title"> + <label for="name" class="oe_edit_only"/> + <h1><field name="name" placeholder="e.g. Sales Manager"/></h1> + </div> + <notebook> + <page string="Job Description"> + <div attrs="{'invisible': [('state', '!=', 'recruit')]}"> + <label for="description"/> + <field name="description"/> + </div> + </page> + <page string="Recruitment"> + <group> + <group name="recruitment"> + <field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/> + <field name="department_id"/> + </group> + <group> + <field name="no_of_recruitment"/> + </group> + </group> + </page> + </notebook> + </sheet> + <div class="oe_chatter"> + <field name="message_follower_ids" options="{'open_attachments': True}"/> + </div> + </form> + </field> + </record> + + <record id="view_hr_job_tree" model="ir.ui.view"> + <field name="name">hr.job.tree</field> + <field name="model">hr.job</field> + <field name="arch" type="xml"> + <tree string="Job" sample="1"> + <field name="name"/> + <field name="department_id"/> + <field name="no_of_employee"/> + <field name="no_of_recruitment"/> + <field name="expected_employees"/> + <field name="no_of_hired_employee"/> + <field name="state"/> + <field name="message_needaction" invisible="1"/> + <field name="company_id" groups="base.group_multi_company"/> + </tree> + </field> + </record> + + <record id="hr_job_view_kanban" model="ir.ui.view"> + <field name="name">hr.job.kanban</field> + <field name="model">hr.job</field> + <field name="arch" type="xml"> + <kanban class="o_kanban_mobile" sample="1"> + <templates> + <t t-name="kanban-box"> + <div class="oe_kanban_global_click"> + <div> + <strong><field name="name"/></strong> + </div> + <div> + <span><field name="department_id"/>&nbsp;</span> + </div> + <div t-if="!selection_mode"> + <span>Vacancies : <field name="expected_employees"/></span> + <span t-att-class="record.state.raw_value == 'recruit' and 'float-right badge badge-success' or 'float-right badge badge-danger'"> + <field name="state"/> + </span> + </div> + </div> + </t> + </templates> + </kanban> + </field> + </record> + + <record id="view_job_filter" model="ir.ui.view"> + <field name="name">hr.job.search</field> + <field name="model">hr.job</field> + <field name="arch" type="xml"> + <search string="Jobs"> + <field name="name" string="Job Position"/> + <field name="department_id" operator="child_of"/> + <filter name="in_position" string="In Position" domain="[('state', '=', 'open')]"/> + <filter name="in_recruitment" string="In Recruitment" domain="[('state', '=', 'recruit')]"/> + <separator/> + <filter name="message_needaction" string="Unread Messages" domain="[('message_needaction', '=', True)]"/> + <group expand="0" string="Group By"> + <filter string="Department" name="department" domain="[]" context="{'group_by': 'department_id'}"/> + <filter string="Status" name="status" domain="[]" context="{'group_by': 'state'}"/> + <filter string="Company" name="company" domain="[]" context="{'group_by': 'company_id'}" groups="base.group_multi_company"/> + </group> + </search> + </field> + </record> + + <record id="action_hr_job" model="ir.actions.act_window"> + <field name="name">Job Positions</field> + <field name="res_model">hr.job</field> + <field name="view_mode">tree,form</field> + <field name="search_view_id" ref="view_job_filter"/> + <field name="context">{"search_default_Current":1}</field> + <field name="help" type="html"> + <p class="o_view_nocontent_smiling_face"> + Ready to recruit more efficiently? + </p><p> + Let's create a job position. + </p> + </field> + </record> + + </data> +</odoo> diff --git a/addons/hr/views/hr_plan_views.xml b/addons/hr/views/hr_plan_views.xml new file mode 100644 index 00000000..0523a94e --- /dev/null +++ b/addons/hr/views/hr_plan_views.xml @@ -0,0 +1,100 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <data> + + <record id="hr_plan_view_search" model="ir.ui.view"> + <field name="name">hr.plan.view.search</field> + <field name="model">hr.plan</field> + <field name="arch" type="xml"> + <search string="Plan"> + <field name="name"/> + <separator/> + <filter string="Archived" name="inactive" domain="[('active', '=', False)]"/> + </search> + </field> + </record> + + <record id="hr_plan_view_tree" model="ir.ui.view"> + <field name="name">hr.plan.view.tree</field> + <field name="model">hr.plan</field> + <field name="arch" type="xml"> + <tree string="Planning"> + <field name="name"/> + </tree> + </field> + </record> + + <record id="hr_plan_view_form" model="ir.ui.view"> + <field name="name">hr.plan.view.form</field> + <field name="model">hr.plan</field> + <field name="arch" type="xml"> + <form string="Planning"> + <sheet> + <widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/> + <div class="oe_title"> + <label for="name" class="oe_edit_only"/> + <h1> + <field name="name"/> + </h1> + </div> + <group string="Activities"> + <field name="active" invisible="1"/> + <field name="plan_activity_type_ids" nolabel="1"> + <tree editable="bottom"> + <field name="activity_type_id"/> + <field name="summary"/> + <field name="responsible"/> + <field name="responsible_id" attrs="{'readonly': [('responsible', '!=', 'other')]}"/> + </tree> + </field> + </group> + </sheet> + </form> + </field> + </record> + + <record id="hr_plan_activity_type_view_tree" model="ir.ui.view"> + <field name="name">hr.plan.activity.type.view.tree</field> + <field name="model">hr.plan.activity.type</field> + <field name="arch" type="xml"> + <tree string="Activities"> + <field name="activity_type_id"/> + <field name="summary"/> + <field name="responsible"/> + </tree> + </field> + </record> + + <record id="hr_plan_activity_type_view_form" model="ir.ui.view"> + <field name="name">hr.plan.activity.type.view.form</field> + <field name="model">hr.plan.activity.type</field> + <field name="arch" type="xml"> + <form string="Activity"> + <sheet> + <group> + <field name="activity_type_id"/> + <field name="summary"/> + <field name="responsible"/> + <field name="responsible_id" attrs="{'invisible': [('responsible', '!=', 'other')]}"/> + <field name="note"/> + </group> + </sheet> + </form> + </field> + </record> + + <record id="hr_plan_action" model="ir.actions.act_window"> + <field name="name">Planning</field> + <field name="res_model">hr.plan</field> + <field name="view_mode">tree,form</field> + <field name="search_view_id" ref="hr_plan_view_search"/> + </record> + + <record id="hr_plan_activity_type_action" model="ir.actions.act_window"> + <field name="name">Planning Types</field> + <field name="res_model">hr.plan.activity.type</field> + <field name="view_mode">tree,form</field> + </record> + + </data> +</odoo> diff --git a/addons/hr/views/hr_templates.xml b/addons/hr/views/hr_templates.xml new file mode 100644 index 00000000..5d4bcd9d --- /dev/null +++ b/addons/hr/views/hr_templates.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + + <template id="assets_backend" name="hr assets" inherit_id="web.assets_backend"> + <xpath expr="." position="inside"> + <link rel="stylesheet" type="text/scss" href="/hr/static/src/scss/hr.scss"/> + <link rel="stylesheet" type="text/scss" href="/hr/static/src/bugfix/bugfix.scss"/> + + <script type="text/javascript" src="/hr/static/src/bugfix/bugfix.js"/> + <script type="text/javascript" src="/hr/static/src/js/chat.js"></script> + <script type="text/javascript" src="/hr/static/src/js/language.js"></script> + <script type="text/javascript" src="/hr/static/src/js/many2one_avatar_employee.js"></script> + <script type="text/javascript" src="/hr/static/src/js/standalone_m2o_avatar_employee.js"></script> + <script type="text/javascript" src="/hr/static/src/models/employee/employee.js"/> + <script type="text/javascript" src="/hr/static/src/models/messaging/messaging.js"/> + <script type="text/javascript" src="/hr/static/src/models/partner/partner.js"/> + <script type="text/javascript" src="/hr/static/src/models/user/user.js"/> + </xpath> + </template> + + <template id="qunit_suite" name="hr tests" inherit_id="web.qunit_suite_tests"> + <xpath expr="." position="inside"> + <script type="text/javascript" src="/hr/static/src/bugfix/bugfix_tests.js"/> + <script type="text/javascript" src="/hr/static/tests/helpers/mock_models.js"/> + <script type="text/javascript" src="/hr/static/tests/many2one_avatar_employee_tests.js"></script> + <script type="text/javascript" src="/hr/static/tests/standalone_m2o_avatar_employee_tests.js"></script> + </xpath> + </template> +</odoo> diff --git a/addons/hr/views/hr_views.xml b/addons/hr/views/hr_views.xml new file mode 100644 index 00000000..713abc3d --- /dev/null +++ b/addons/hr/views/hr_views.xml @@ -0,0 +1,117 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <data> + + <menuitem + id="menu_hr_root" + name="Employees" + groups="group_hr_manager,group_hr_user,base.group_user" + web_icon="hr,static/description/icon.png" + sequence="75"/> + + <menuitem + id="menu_hr_main" + name="Human Resources" + parent="menu_hr_root" + sequence="0"/> + + <menuitem + id="menu_hr_employee_payroll" + name="Employees" + parent="menu_hr_root" + groups="group_hr_user" + sequence="3"/> + + <menuitem + id="menu_hr_employee_user" + name="Employees" + action="open_view_employee_list_my" + parent="menu_hr_employee_payroll" + sequence="1"/> + + <menuitem + id="menu_hr_employee" + name="Employee Directory" + action="hr_employee_public_action" + parent="menu_hr_root" + sequence="4"/> + + <menuitem + id="hr_menu_hr_reports" + name="Reporting" + parent="menu_hr_root" + sequence="95"/> + + <menuitem + id="menu_hr_reporting_timesheet" + name="Reporting" + parent="menu_hr_root" + groups="group_hr_manager,group_hr_user" + sequence="99"/> + + <menuitem + id="menu_human_resources_configuration" + name="Configuration" + parent="menu_hr_root" + groups="hr.group_hr_user" + sequence="100"/> + + <menuitem + id="menu_view_hr_job" + action="action_hr_job" + parent="menu_human_resources_configuration" + sequence="1"/> + + <menuitem + id="menu_human_resources_configuration_employee" + name="Employee" + parent="menu_human_resources_configuration" + groups="base.group_no_one" + sequence="1"/> + + <menuitem + id="menu_view_employee_category_form" + name="Tags" + action="open_view_categ_form" + parent="menu_human_resources_configuration_employee" + groups="base.group_no_one" + sequence="1"/> + + <menuitem + id="menu_hr_department_tree" + action="hr_department_tree_action" + parent="menu_human_resources_configuration" + sequence="2" + groups="group_hr_user"/> + + <menuitem + id="menu_hr_department_kanban" + action="hr_department_kanban_action" + parent="menu_hr_root" + groups="group_hr_user"/> + + <menuitem + id="menu_config_plan" + name="Activity Planning" + parent="menu_human_resources_configuration" + groups="group_hr_manager" + sequence="100"/> + + <menuitem + id="menu_config_plan_types" + name="Planning Types" + action="hr_plan_activity_type_action" + parent="menu_config_plan" + groups="base.group_no_one" + sequence="99"/> + + <menuitem + id="menu_config_plan_plan" + name="Plans" + action="hr_plan_action" + parent="menu_config_plan" + groups="group_hr_manager" + sequence="100"/> + + </data> +</odoo> diff --git a/addons/hr/views/mail_channel_views.xml b/addons/hr/views/mail_channel_views.xml new file mode 100644 index 00000000..25ad1350 --- /dev/null +++ b/addons/hr/views/mail_channel_views.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" ?> +<odoo><data> + <record id="mail_channel_view_form_" model="ir.ui.view"> + <field name="name">mail.channel.view.form.inherit.hr</field> + <field name="model">mail.channel</field> + <field name="inherit_id" ref="mail.mail_channel_view_form"/> + <field name="arch" type="xml"> + <xpath expr="//field[@name='group_ids']" position="after"> + <field name="subscription_department_ids" widget="many2many_tags" + string="Auto Subscribe Departments"/> + </xpath> + </field> + </record> +</data></odoo>
\ No newline at end of file diff --git a/addons/hr/views/res_config_settings_views.xml b/addons/hr/views/res_config_settings_views.xml new file mode 100644 index 00000000..e1b04429 --- /dev/null +++ b/addons/hr/views/res_config_settings_views.xml @@ -0,0 +1,126 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <record id="res_config_settings_view_form" model="ir.ui.view"> + <field name="name">res.config.settings.view.form.inherit.hr</field> + <field name="model">res.config.settings</field> + <field name="priority" eval="70"/> + <field name="inherit_id" ref="base.res_config_settings_view_form"/> + <field name="arch" type="xml"> + <xpath expr="//div[hasclass('settings')]" position="inside"> + <div class="app_settings_block" data-string="Employees" string="Employees" data-key="hr" groups="hr.group_hr_manager"> + <h2>Employees</h2> + <div class="row mt16 o_settings_container" name="employees_setting_container"> + <div class="col-12 col-lg-6 o_setting_box" id="presence_control_setting" title="Presence of employees"> + + <div class="o_setting_right_pane"> + <span class="o_form_label">Presence Control</span> + <div class="content-group" name="hr_presence_options"> + <div class="row"> + <field name="module_hr_attendance" class="col-lg-1 ml16"/> + <label for="module_hr_attendance" class="o_light_label"/> + </div> + <div class="row"> + <field name="hr_presence_control_login" class="col-lg-1 ml16"/> + <label for="hr_presence_control_login" class="o_light_label"/> + </div> + </div> + </div> + </div> + <div class="col-12 col-lg-6 o_setting_box" + id="presence_reporting_setting" + title="Advanced presence of employees"> + <div class="o_setting_left_pane"> + <field name="module_hr_presence"/> + </div> + <div class="o_setting_right_pane"> + <label for="module_hr_presence"/> + <div class="text-muted" name="hr_presence_options_advanced"> + Presence reporting screen, email and IP address control. + </div> + <div class="row mt-1" attrs="{'invisible': [('module_hr_presence', '=', False)]}"> + <field name="hr_presence_control_email" class="col-lg-1 ml16"/> + <label for="hr_presence_control_email" class="o_light_label"/> + </div> + <div class="row ml32" attrs="{'invisible': ['|', ('module_hr_presence', '=', False), ('hr_presence_control_email', '=', False)]}"> + <span class="ml8 mr-2">Minimum number of emails to sent </span> + <field name="hr_presence_control_email_amount" class="ml-2 oe_inline"/> + </div> + <div class="row" attrs="{'invisible': [('module_hr_presence', '=', False)]}"> + <field name="hr_presence_control_ip" class="col-lg-1 ml16"/> + <label for="hr_presence_control_ip" class="o_light_label"/> + </div> + <div class="row ml32" attrs="{'invisible': ['|', ('module_hr_presence', '=', False), ('hr_presence_control_ip', '=', False)]}"> + <span class="ml8 mr-2">IP Addresses (comma-separated)</span> + <field name="hr_presence_control_ip_list" class="ml-2 oe_inline"/> + </div> + </div> + </div> + <div class="col-12 col-lg-6 o_setting_box" id="enrich_employee_setting"> + <div class="o_setting_left_pane"> + <field name="module_hr_skills"/> + </div> + <div class="o_setting_right_pane"> + <label for="module_hr_skills"/> + <div class="text-muted"> + Enrich employee profiles with skills and resumes + </div> + </div> + </div> + </div> + <h2>Work Organization</h2> + <div class="row mt16 o_settings_container" name="work_organization_setting_container"> + <div class="col-12 col-lg-6 o_setting_box" id="default_company_schedule_setting"> + <div class="o_setting_right_pane"> + <label for="resource_calendar_id"/> + <span class="fa fa-lg fa-building-o" title="Values set here are company-specific." role="img" aria-label="Values set here are company-specific." groups="base.group_multi_company"/> + <div class="row"> + <div class="text-muted col-lg-8"> + Set default company schedule to manage your employees working time + </div> + </div> + <div class="content-group"> + <div class="mt16"> + <field name="resource_calendar_id" required="1" + class="o_light_label" + domain="[('company_id', '=', company_id)]" + context="{'default_company_id': company_id}"/> + </div> + </div> + </div> + </div> + </div> + <h2>Employee Update Rights</h2> + <div class="row mt16 o_settings_container" name="employee_rights_setting_container"> + <div class="col-12 col-lg-6 o_setting_box" title="Allow employees to update their own data."> + <div class="o_setting_left_pane"> + <field name="hr_employee_self_edit"/> + </div> + <div class="o_setting_right_pane"> + <label for="hr_employee_self_edit"/> + <div class="text-muted"> + Allow employees to update their own data + </div> + </div> + </div> + </div> + </div> + </xpath> + </field> + </record> + + <record id="hr_config_settings_action" model="ir.actions.act_window"> + <field name="name">Settings</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">res.config.settings</field> + <field name="view_mode">form</field> + <field name="target">inline</field> + <field name="context">{'module' : 'hr', 'bin_size': False}</field> + </record> + + <menuitem id="hr_menu_configuration" + name="Settings" + parent="menu_human_resources_configuration" + sequence="0" + action="hr_config_settings_action" + groups="base.group_system"/> +</odoo> diff --git a/addons/hr/views/res_users.xml b/addons/hr/views/res_users.xml new file mode 100644 index 00000000..e31c0320 --- /dev/null +++ b/addons/hr/views/res_users.xml @@ -0,0 +1,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> |
