1
0
forked from Mapan/odoo17e
odoo17e-kedaikipas58/addons/hr_appraisal/views/hr_employee_views.xml
2024-12-10 09:04:09 +07:00

107 lines
5.1 KiB
XML

<?xml version="1.0" ?>
<odoo>
<record id="hr_employee_view_search" model="ir.ui.view">
<field name="name">hr.employee.view.search.inherit.appraisal</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_filter"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='message_needaction']" position="after">
<filter string="Upcoming Appraisals" name="next_appraisal"
domain="[('next_appraisal_date', '&lt;', (context_today() + relativedelta(days=90)).strftime('%Y-%m-%d'))]"/>
</xpath>
<xpath expr="//filter[@name='group_start']" position="after">
<filter name="group_next_appraisal" string="Next Appraisal" domain="[]" context="{'group_by': 'next_appraisal_date'}"/>
</xpath>
</field>
</record>
<record id="hr_employee_view_form" model="ir.ui.view">
<field name="name">hr.employee.view.form.inherit.appraisal</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="priority" eval="80"/>
<field name="arch" type="xml">
<xpath expr="//header" position="inside">
<field name="parent_user_id" invisible="1"/>
<field name="ongoing_appraisal_count" invisible="1"/>
<button name="action_send_appraisal_request"
string="Request Appraisal"
type="object"
data-hotkey="g"
groups="!hr_appraisal.group_hr_appraisal_user"
class="btn btn-primary"
invisible="parent_user_id != uid and ongoing_appraisal_count != 0"/>
<button name="action_send_appraisal_request"
string="Request Appraisal"
type="object"
data-hotkey="g"
groups="hr_appraisal.group_hr_appraisal_user"
invisible="ongoing_appraisal_count != 0"
class="btn btn-primary"/>
</xpath>
<div name="button_box" position="inside">
<field name="appraisal_count" invisible="1"/>
<field name="ongoing_appraisal_count" invisible="1"/>
<field name="last_appraisal_id" invisible="1"/>
<button name="action_open_last_appraisal"
class="oe_stat_button" invisible="not last_appraisal_id"
icon="fa-star-half-o"
type="object">
<div class="o_field_widget o_stat_info">
<div invisible="ongoing_appraisal_count == 0">
<span class="o_stat_text">
Ongoing Appraisal
</span>
<span class="o_stat_value">
<field name="ongoing_appraisal_count" readonly="1"/>
</span>
</div>
<div invisible="ongoing_appraisal_count > 0">
<span class="o_stat_text">
Last Appraisal
</span>
<span class="o_stat_value">
<field name="last_appraisal_date" readonly="1"/>
</span>
</div>
</div>
</button>
</div>
<group name="application_group" position="attributes">
<attribute name="invisible">0</attribute>
</group>
<group name="application_group" position="inside">
<field name="parent_user_id" invisible="1"/>
</group>
<field name="coach_id" position="after">
<field name="next_appraisal_date" invisible="ongoing_appraisal_count != 0"/>
<field name="next_appraisal_date" placeholder="Ongoing" invisible="ongoing_appraisal_count == 0"/>
</field>
</field>
</record>
<record id="view_employee_tree" model="ir.ui.view">
<field name="name">hr.employee.view.tree.inherit</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_tree"/>
<field name="arch" type="xml">
<xpath expr="//tree" position="inside">
<field name="next_appraisal_date" optional="hide"/>
</xpath>
</field>
</record>
<record model="ir.actions.server" id="action_create_multi_appraisals">
<field name="name">Request Appraisals</field>
<field name="sequence">6</field>
<field name="model_id" ref="hr.model_hr_employee"/>
<field name="binding_model_id" ref="hr.model_hr_employee"/>
<field name="binding_view_types">list</field>
<field name="state">code</field>
<field name="groups_id" eval="[(4, ref('hr_appraisal.group_hr_appraisal_user'))]"/>
<field name="code">
action = model._create_multi_appraisals()
</field>
</record>
</odoo>