Files
enterprise-addons/sale_timesheet_enterprise/wizard/edit_billable_time_target_views.xml
T

201 lines
12 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_edit_billable_time_target_update_filter" model="ir.ui.view">
<field name="name">view.hr.employee.update.filter</field>
<field name="model">edit.billable.time.target</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="department_id"/>
<searchpanel view_types="kanban,list,graph,pivot,hierarchy">
<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>
<field name="parent_id" string="Manager" domain="[('company_id', 'in', allowed_company_ids)]"/>
<field name="timesheet_manager_id" domain="[('company_id', 'in', allowed_company_ids)]"/>
<field name="resource_calendar_id"/>
<field name="company_id"/>
<separator/>
<filter name="my_team" string="My Team" domain="[('parent_id.user_id', '=', uid)]"/>
<filter name="my_department" string="My Department" domain="[('member_of_department', '=', True)]"/>
<separator/>
<filter name="newly_hired" string="Newly Hired" domain="[('newly_hired', '=', True)]"/>
<separator/>
<filter name="inactive" string="Archived" domain="[('active', '=', False)]"/>
<group>
<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 Position" domain="[]" context="{'group_by': 'job_id'}"/>
<separator name="main_groupby_separator"/>
<filter name="group_start" string="Start Date" domain="[]" context="{'group_by': 'create_date'}"/>
<separator name="secondary_groupby_separator"/>
<separator name="managers_groupby_separator"/>
</group>
</search>
</field>
</record>
<record id="view_edit_billable_time_target_update_form" model="ir.ui.view">
<field name="name">edit.billable.time.target.form</field>
<field name="model">edit.billable.time.target</field>
<field name="arch" type="xml">
<form string="Employee">
<field name="image_128" invisible="1" />
<header/>
<sheet>
<field name="user_id" invisible="1"/>
<field name="active" invisible="1"/>
<widget name="web_ribbon" title="Archived" bg_color="text-bg-danger" invisible="active"/>
<div class="row justify-content-between position-relative w-100 m-0 mb-2">
<div class="oe_title ps-0 pe-2">
<label for="name" string="Employee Name"/>
<h1 class="d-flex flex-row">
<span class="me-2" invisible="not context.get('chat_icon')">
<widget name="hr_employee_chat"/>
</span>
<field name="name" placeholder="e.g. John Doe" required="True"
style="font-size: min(4vw, 2.6rem);"/>
</h1>
<h2>
<field name="job_id" placeholder="Job Position"/>
</h2>
</div>
<div class="o_employee_avatar m-0 p-0">
<field name="avatar_1920" widget='image' class="oe_avatar" options='{"zoom": true, "preview_image":"avatar_128"}'/>
<field name="show_hr_icon_display" invisible="1" />
<field name="hr_icon_display" invisible="not show_hr_icon_display or not id" widget="hr_presence_status"/>
</div>
</div>
<group>
<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" context="{'open_employees_kanban': 1}"/>
<field name="job_id"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="parent_id" widget="many2one_avatar_user"/>
<field name="coach_id" widget="many2one_avatar_user"/>
</group>
</group>
<notebook>
<page name="public" string="Work Information">
<div id="o_work_employee_container" class="d-lg-flex"> <!-- These two div are used to position org_chart -->
<div id="o_work_employee_main" class="flex-grow-1">
<group string="Location" name="location">
<field name="address_id"
context="{'show_address': 1}"
options='{"highlight_first_line": True}'/>
<field name="work_location_id"/>
</group>
<group name="timesheets" string="Timesheets">
<span class="o_wrap_label" >
<label string="Billing Time Target" for="billable_time_target"/>
</span>
<span class="d-flex w-50" name="billable_time_target">
<field name="billable_time_target" widget="timesheet_uom_no_toggle"/>
<span class="m-14 w-100">per month</span>
</span>
</group>
</div>
<div id="o_employee_org_chart" class="col-lg-5">
<separator string="Organization Chart"/>
<field name="child_ids" class="position-relative" widget="hr_org_chart" readonly="1" nolabel="1"/>
</div>
</div>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="view_edit_billable_time_target_update_tree" model="ir.ui.view">
<field name="name">edit.billable.time.target.tree</field>
<field name="model">edit.billable.time.target</field>
<field name="arch" type="xml">
<list string="Edit Billable Time Target" multi_edit="1" editable="bottom" open_form_view="True">
<field name="name"/>
<field name="company_id" optional="hide" options="{'no_open': True}"/>
<field name="department_id" optional="hide" options="{'no_open': True}"/>
<field name="job_id" context="{'default_no_of_recruitment': 0, 'default_is_favorite': False}" options="{'no_open': True}" optional="hide"/>
<field name="parent_id" optional="hide" widget="many2one_avatar_employee"/>
<field name="timesheet_manager_id" optional="hide" string="Timesheet Approver" widget="many2one_avatar_user"/>
<field name="resource_calendar_id" optional="show" options="{'no_open': True}"/>
<field name="billable_time_target" widget="timesheet_uom_no_toggle" avg="Average"/>
</list>
</field>
</record>
<record id="view_edit_billable_time_target_update_kanban" model="ir.ui.view">
<field name="name">edit.billable.time.target.kanban</field>
<field name="model">edit.billable.time.target</field>
<field name="arch" type="xml">
<kanban class="o_hr_employee_kanban" sample="1">
<field name="show_hr_icon_display"/>
<field name="image_128" />
<field name="company_id"/>
<templates>
<t t-name="card" class="flex-row">
<aside class="o_kanban_aside_full">
<t t-if="record.image_1024.raw_value">
<field name="image_1024" widget="background_image" options="{'zoom': true, 'zoom_delay': 1000, 'preview_image':'image_128'}" class="d-block position-relative"/>
</t>
<t t-elif="record.image_128.raw_value">
<field name="avatar_128" widget="background_image" options="{'zoom': true, 'zoom_delay': 1000}" class="d-block position-relative"/>
</t>
<div t-else="" class="d-flex align-items-center justify-content-center bg-100 bg-gradient">
<svg class="w-75 h-75 opacity-50" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
<g fill="currentColor">
<path d="M 10 11 C 4.08 11 2 14 2 16 L 2 19 L 18 19 L 18 16 C 18 14 15.92 11 10 11 Z"/>
<circle cx="10" cy="5.5" r="4.5"/>
</g>
</svg>
</div>
</aside>
<main class="ms-2">
<div>
<field class="fw-bold fs-5" name="name" placeholder="Employee's Name"/>
<div t-if="record.show_hr_icon_display.raw_value" class="float-end">
<field name="hr_icon_display" widget="hr_presence_status" />
</div>
</div>
<field t-if="record.job_id.raw_value" name="job_id"/>
<div t-if="record.work_email.raw_value" class="o_text_overflow">
<i class="fa fa-fw me-2 fa-envelope text-primary" title="Email"/>
<field name="work_email" />
</div>
<div t-if="record.work_phone.raw_value">
<i class="fa fa-fw me-2 fa-phone text-primary" title="Phone"/>
<field name="work_phone" />
</div>
<div invisible="birthday_public_display_string == 'hidden'">
<i class="fa fa-fw me-2 fa-birthday-cake text-primary" title="Birthday"/>
<field name="birthday_public_display_string"/>
</div>
<footer>
<div class="d-flex ms-auto">
<field name="user_id" widget="many2one_avatar_user" readonly="1" class="mb-1 ms-2"/>
</div>
</footer>
</main>
</t>
</templates>
</kanban>
</field>
</record>
<record id="action_open_edit_billable_time_target" model="ir.actions.act_window">
<field name="name">Employees</field>
<field name="res_model">edit.billable.time.target</field>
<field name="view_mode">list,kanban,form</field>
<field name="search_view_id" ref="view_edit_billable_time_target_update_filter"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face"> No employees found </p>
<p> Set a billing time target for employees whose timesheets you approve. </p>
</field>
</record>
</odoo>