odex25_standard/odex25_hr/exp_official_mission/views/training.xml

823 lines
64 KiB
XML

<?xml version="1.0"?>
<odoo>
<data>
<record model="ir.actions.act_window" id="employee_training_action">
<field name="name">Employee Training</field>
<field name="res_model">hr.official.mission</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('process_type','=','training')]</field>
<field name="context">{'default_process_type':'training'}</field>
</record>
<menuitem name="Employee Training" id="employee_training_menu_item"
parent="employee_requests.employee_request_menu_item"
action="employee_training_action" />
<record model="ir.ui.view" id="employee_training_form_view">
<field name="name">Employee Training</field>
<field name="model">hr.official.mission</field>
<field name="arch" type="xml">
<form>
<header>
<button name="send_depart_manager" string="Submit"
class="oe_highlight"
type="object"
states="draft" groups="base.group_user" />
<button name="direct_manager"
string="Direct Manager Approve"
class="oe_highlight" type="object"
states="send"
groups="hr_base.group_division_manager" />
<button name="direct_manager_refused" string="Refused"
class="oe_highlight"
type="object"
states="send"
groups="hr_base.group_division_manager" />
<button name="depart_manager" string="Department Manager"
class="oe_highlight" type="object"
states="direct_manager"
groups="hr_base.group_department_manager" />
<button name="dep_manager_refused" string="Refused"
class="oe_highlight"
type="object"
states="direct_manager"
groups="hr_base.group_department_manager" />
<button name="hr_aaproval" string="HR Approval"
class="oe_highlight"
type="object"
states="depart_manager"
groups="exp_official_mission.group_hr_training_user" />
<button name="refused" string="Refused"
class="oe_highlight" type="object"
states="depart_manager"
groups="exp_official_mission.group_hr_training_user" />
<button name="approve" string="Approve"
class="oe_highlight" type="object"
states="hr_aaproval"
groups="exp_official_mission.group_hr_training_manager" />
<button name="refused" string="Refused"
class="oe_highlight" type="object"
states="hr_aaproval"
groups="exp_official_mission.group_hr_training_manager" />
<button name="draft_state" string="RE-Draft"
class="oe_highlight"
type="object"
states="approve,refused" groups="hr.group_hr_user"
confirm="Are you sure to Reset To Draft This Record?" />
<button name="action_training_appraisal"
string="Training Course Appraisal"
type="object" class="oe_highlight"
icon="fa-users"
attrs="{'invisible':['|',('state','in',('draft','refused')),('appraisal_found','=',True)]}" />
<field name="state" widget="statusbar"
statusbar_visible="draft,send,direct_manager,depart_manager,hr_aaproval,approve,refused" />
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button name="action_get_attachment_view"
class="oe_stat_button"
icon="fa-file-text-o"
type="object">
<field name="attachment_count"
widget="statinfo"
string="Attachments"
options="{'reload_on_button': true}" />
</button>
<button name="action_employees_appraisal"
class="oe_stat_button"
icon="fa-file-text-o"
type="object">
<field name="appraisal_count"
widget="statinfo"
string="Employees Appraisal"
options="{'reload_on_button': true}" />
</button>
</div>
<group>
<group>
<field name="hr_nomination"
attrs="{'readonly': [('state', '!=', 'draft')]}"
groups="hr.group_hr_user" />
<field name="process_type" invisible="1" />
<field name="mission_type"
string="Mission Type" required="1"
domain="[('work_state', '=', 'training'),('special_hours', '!=', True)]"
attrs="{'readonly':[('state','not in',('draft','direct_manager','depart_manager','send'))] }" />
<field name="course_name"
string="Course Name" required="1"
attrs="{'readonly':[('state','not in',('draft','direct_manager','depart_manager','send'))] }" />
<field name="train_category"
string="Category" required="1"
attrs="{'readonly':[('state','not in',('draft','direct_manager','depart_manager','send'))] }" />
<!--when
Duration type in mission type is days-->
<field name="duration_type"
string="Duration Type" invisible="1" />
<field name="date_from" string="Date From"
required="1"
attrs="{'readonly':[('state','not in',('draft','direct_manager','depart_manager','send'))] }" />
<field name="date_to" string="Date To"
required="1"
attrs="{'readonly':[('state','not in',('draft','direct_manager','depart_manager','send'))] }" />
<!--when
Duration type in mission type is hours-->
<field name="hour_from" string="Hour From"
widget="float_time"
attrs="{'required': [('state', '=', 'depart_manager')],
'readonly':[('state','not in',('draft','direct_manager','depart_manager','send'))] }" />
<field name="hour_to" string="Hour To"
widget="float_time"
attrs="{'required': [('state', '=', 'depart_manager')],
'readonly':[('state','not in',('draft','direct_manager','depart_manager','send'))] }" />
<field name="hour_duration"
string="Duration Hours" readonly="1"
force_save="1"
widget="float_time"
attrs="{'required':[('duration_type','=','hours')]}" />
<field name="date_duration"
string="Duration Days" readonly="1"
force_save="1"
attrs="{'required':[('duration_type','=','days')]}" />
<field name="total_hours"
string="Total Hours" readonly="1"
force_save="1"
/>
</group>
<group>
<field name="company_id"
groups="base.group_multi_company"
readonly="1" />
<field name="employee_id"
string="Responsible" required="1"
attrs="{'readonly':[('state','!=','draft')]}" />
<field name="employee_no"
string="Employee Number" readonly="1" />
<field name="department_id2"
string="Department" readonly="1" />
<field name="date" string="Date Request"
attrs="{'readonly':[('state','!=','draft')]}"
required="1" />
<field name="department_id"
string="Department"
widget="many2many_tags"
attrs="{'readonly':[('state','=','approve')]}" />
<field name="country_id" string="Country"
attrs="{'readonly':[('state','!=','draft')]}" />
<field name="destination"
string="Destination"
widget="selection"
domain="[('country_id','=',country_id),('destination_type','in',('training','all'))]"
attrs="{'readonly':[('state','not in',('draft','direct_manager','depart_manager','send'))] }" />
<field name="partner_id" string="Organiser"
required="1"
context="{'default_training': True}"
domain="[('training', '=', True)]"
attrs="{'readonly':[('state','=','approve')]}" />
<field name="trainer_id"
context="{'default_training': True}"
domain="[('is_company', '=', False), ('training', '=', True)]"
attrs="{'readonly':[('state','=','approve')]}" />
<field name="move_type" string="Move type"
attrs="{'readonly':[('state','!=','depart_manager')], 'required': [('state', '=', 'depart_manager')],'invisible':[('related_with_financial','=',False)]}" />
<field name="official_mission"
string="Allowance Name"
attrs="{'readonly':[('state','!=','depart_manager')],
'invisible':['|',('related_with_financial','=',False),('move_type','!=','payroll')],
'required':[('move_type','=','payroll'),('state', '=', 'depart_manager'),('related_with_financial','=',True)]}" />
<field name="Training_cost"
string="Training Cost"
attrs="{'readonly':[('state','=','approve')]}"
groups="hr_base.group_account_manager,hr.group_hr_user,hr_base.group_division_manager" />
<field name="Tra_cost_invo_id"
string="Training Cost Invoice"
attrs="{'invisible':['|',('state','!=','approve'),('Tra_cost_invo_id','=',False)]}"
groups="hr_base.group_account_manager,hr.group_hr_user,hr_base.group_division_manager" />
<field name="min_of_employee"
string="Min Trainees"
attrs="{'readonly':[('state','=','approve')]}"
groups="hr_base.group_account_manager,hr.group_hr_user,hr_base.group_division_manager" />
<field name="max_of_employee"
string="Max Trainees"
attrs="{'readonly':[('state','=','approve')]}"
groups="hr_base.group_account_manager,hr.group_hr_user,hr_base.group_division_manager" />
<field name="appraisal_check" invisible="1" />
<field name="appraisal_found" invisible="1" />
</group>
</group>
<!--group
string="Mission Purpose">
<field name="mission_purpose" nolabel="1"
attrs="{'readonly':[('state','!=','draft')]}" required="1"/>
</group-->
<notebook>
<page string="Employees" name="employees">
<field name="related_with_financial"
invisible="1" />
<div
style="display: inline-block;margin-right: 2px;">
<button name="action_add_employees"
string=" Add Employees "
type="object"
class="oe_highlight"
icon="fa-users" />
<button name="re_compute"
string=" Re-Compute "
type="object"
class="oe_highlight"
icon="fa-cogs"
style="margin-right: 20px;"
attrs="{'invisible':[('state','in',('approve','refused','send'))]}" />
</div>
<field name="employee_ids"
attrs="{'readonly':[('state','not in',('depart_manager','direct_manager','send','draft'))]}">
<tree editable="bottom">
<field name="employee_id"
string="Employee"
required="1" />
<field name="date_from"
string="Date from" />
<field name="date_to"
string="Date to" />
<field name="days"
string="Days"
readonly="0" />
<field name="day_price"
string="Day price"
groups="hr_base.group_account_manager,hr.group_hr_user"
attrs="{'column_invisible':['|',('parent.duration_type','!=','days'),
('parent.related_with_financial','=',False)]}"
readonly="1"
force_save="1" />
<field name="hour_from"
string="Hour from"
widget="float_time"
/>
<field name="hour_to"
string="Hour to"
widget="float_time"
/>
<field name="hours"
string="Hours"
readonly="0"
widget="float_time" />
<field name="total_hours"
string="Total Hours"
readonly="0"
widget="float_time" />
<field name="hour_price"
string="Hour price"
groups="hr_base.group_account_manager,hr.group_hr_user"
attrs="{'column_invisible':['|',('parent.duration_type','!=','hours'),
('parent.related_with_financial','=',False)]}"
readonly="1"
force_save="1" />
<field name="fees_amount"
string="Fees Amount"
attrs="{'column_invisible':[('parent.related_with_financial','=',False)]}"
readonly="0" />
<field name="train_cost_emp"
string="Training Cost"
groups="hr_base.group_account_manager,hr.group_hr_user,hr_base.group_division_manager" />
<field name="appraisal_id"
string="Appraisal"
readonly="1"
force_save="1"
invisible="1" />
<field name="appraisal_result"
string="Appraisal Result"
readonly="1"
force_save="1"
attrs="{'column_invisible':[('parent.appraisal_check','=',False)]}" />
<field name="amount"
string="Amount"
groups="hr_base.group_account_manager,hr.group_hr_user"
attrs="{'column_invisible':[('parent.related_with_financial','=',False)]}"
readonly="1"
force_save="1" />
<field name="account_move_id"
string="Account move"
readonly="1"
force_save="1"
groups="hr_base.group_account_manager,hr.group_hr_user"
attrs="{'column_invisible':['|',('parent.related_with_financial','=',False),
('parent.move_type','!=','accounting')]}" />
<field name="status"
string="Employee Status" />
<field name="attachment_count"
invisible="1" />
<button
name="action_get_attachment_view"
string="Attachments"
type="object"
icon="fa-paperclip"
attrs="{'invisible': [('attachment_count', '=', 0)]}" />
</tree>
<form
string="Employee Training Course Day">
<sheet>
<group col="4">
<field
name="employee_id"
string="Employee"
required="1" />
<field
name="date_from"
string="Date from" />
<field
name="date_to"
string="Date to" />
<field
name="days"
string="Days"
readonly="0" />
<field
name="day_price"
string="Day price"
groups="hr_base.group_account_manager,hr.group_hr_user"
attrs="{'column_invisible':['|',('parent.duration_type','!=','days'),
('parent.related_with_financial','=',False)]}"
readonly="1"
force_save="1" />
<field
name="hour_from"
string="Hour from"
widget="float_time"
/>
<field
name="hour_to"
string="Hour to"
widget="float_time"
/>
<field
name="hours"
string="Hours"
readonly="0"
widget="float_time" />
<field
name="total_hours"
string="Total Hours"
readonly="0"
widget="float_time" />
<field
name="hour_price"
string="Hour price"
groups="hr_base.group_account_manager,hr.group_hr_user"
attrs="{'column_invisible':['|',('parent.duration_type','!=','hours'),
('parent.related_with_financial','=',False)]}"
readonly="1"
force_save="1" />
<field
name="fees_amount"
string="Fees Amount"
attrs="{'column_invisible':[('parent.related_with_financial','=',False)]}"
readonly="0" />
<field
name="train_cost_emp"
string="Training Cost"
groups="hr_base.group_account_manager,hr.group_hr_user,hr_base.group_division_manager" />
<field
name="appraisal_id"
string="Appraisal"
readonly="1"
force_save="1"
invisible="1" />
<field
name="appraisal_result"
string="Appraisal Result"
readonly="1"
force_save="1"
attrs="{'column_invisible':[('parent.appraisal_check','=',False)]}" />
<field
name="amount"
string="Amount"
groups="hr_base.group_account_manager,hr.group_hr_user"
attrs="{'column_invisible':[('parent.related_with_financial','=',False)]}"
readonly="1"
force_save="1" />
<field
name="account_move_id"
string="Account move"
readonly="1"
force_save="1"
groups="hr_base.group_account_manager,hr.group_hr_user"
attrs="{'column_invisible':['|',('parent.related_with_financial','=',False),
('parent.move_type','!=','accounting')]}" />
</group>
</sheet>
</form>
</field>
</page>
<page string="Requirement Training"
name="refusal_causes">
<group>
<group>
<field name="issuing_ticket"
string="Issuing Ticket?"
attrs="{'readonly':[('state','not in',('draft','depart_manager','send'))],'required':[('issuing_ticket','=','yes')]}" />
<field
name="ticket_cash_request_type"
string="Ticket/Cash Request Type"
attrs="{'readonly':[('state','not in',('draft','depart_manager','send'))],'required':[('issuing_ticket','=','yes')]}" />
<field
name="ticket_cash_request_for"
string="Ticket/Cash Request For"
attrs="{'readonly':[('state','not in',('draft','depart_manager','send'))],'required':[('issuing_ticket','=','yes')]}" />
</group>
<group>
<!-- <field
name="ticket_insurance"
string="Ticket
Insurance"-->
<!--
attrs="{'readonly':[('state','!=','draft')]}"/>-->
<field name="self_car"
string="Self Car"
attrs="{'readonly':[('state','!=','draft')]}" />
<field name="visa"
string="Visa"
attrs="{'readonly':[('state','!=','draft')]}" />
<field name="note"
string="Other"
attrs="{'readonly':[('state','!=','draft')]}" />
</group>
<!-- <group>-->
<!-- <field name="car_insurance"
string="Car Insurance"-->
<!--
attrs="{'readonly':[('state','!=','draft')]}"/>-->
<!-- <field name="car_type"
string="Car Type"-->
<!--
attrs="{'readonly':[('state','!=','draft')]}"/>-->
<!-- <field name="rent_days"
string="Rent Days"-->
<!--
attrs="{'readonly':[('state','!=','draft')]}"/>-->
<!-- <field name="max_rent"
string="Max Rent"-->
<!--
attrs="{'readonly':[('state','!=','draft')]}"/>-->
<!-- </group>-->
</group>
</page>
<page string="Training Details">
<group>
<field name="training_details"
string='Training Details'
required="1"
attrs="{'readonly':[('state','=','approve')]}"
nolabel="1" />
</group>
</page>
<page string="Training Table">
<field name="table_ids"
context="{
'default_hour_from': hour_from,
'default_hour_to': hour_to
}">
<tree editable="bottom">
<field name="description"
string="Description" />
<field name="date"
string="Date Requestt"
required="1" />
<field name="hour_from"
string="Hour from"
required="1"
widget="float_time" />
<field name="hour_to"
string="Hour to"
required="1"
widget="float_time" />
<field name="trainer_id"
string="Trainer"
readonly="0" />
</tree>
</field>
</page>
<page string="Attachments" name="attachments"
invisible="1">
<field name="attach_ids"
string="Attachments"
attrs="{'readonly':[('state','!=','draft')]}">
<tree editable="bottom">
<field name="name"
string="attachment Name" />
<field name="datas"
string="file content" />
</tree>
</field>
</page>
<!--page
string="Information" name="information">
<group>
<group>
<field name="approved_by" string="Approved By"
attrs="{'readonly':[('state','!=','draft')]}"/>
</group>
<group>
<field name="refused_by" string="Refused By"
attrs="{'readonly':[('state','!=','draft')]}"/>
</group>
</group>
</page-->
</notebook>
</sheet>
<div class="o_attachment_preview" />
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers" />
<field name="activity_ids" widget="mail_activity" />
<field name="message_ids" widget="mail_thread" />
</div>
</form>
</field>
</record>
<record model="ir.ui.view" id="employee_training_tree_view">
<field name="name">Employee Training</field>
<field name="model">hr.official.mission</field>
<field name="arch" type="xml">
<tree decoration-danger="state == 'refused'"
decoration-info="state == 'draft'"
string="Employee Training">
<field name="mission_type" string="Mission Type" />
<field name="employee_id" string="Responsible" />
<field name="date" string="Date Request" />
<field name="course_name" string="Course Name" />
<field name="train_category" string="Category" />
<field name="date_from" string="Date From" />
<field name="date_to" string="Date To" />
<field name="total_hours" string="Total Hours" />
<field name="destination" string="Destination" />
<field name="attachment_count" invisible="1" />
<button name="action_get_attachment_view" string="Attachments"
type="object"
icon="fa-paperclip"
attrs="{'invisible': [('attachment_count', '=', 0)]}" />
<field name="state" string="Status" />
</tree>
</field>
</record>
<!-- view_employee_training_filter -->
<record id="view_employee_filter_training" model="ir.ui.view">
<field name="name">Employee Training</field>
<field name="model">hr.official.mission</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search>
<field name="course_name" />
<field name="mission_type" />
<field name="employee_id" />
<field name="employee_no" />
<field name="destination" />
<field name="train_category" />
<field name="state" />
<group expand="0" string="Group By">
<filter name="group_employee" string="Responsible"
domain="[]"
context="{'group_by': 'employee_id'}" />
<filter name="group_type" string="Mission Type"
domain="[]"
context="{'group_by': 'mission_type'}" />
<filter name="group_department" string="Department"
domain="[]"
context="{'group_by': 'department_id2'}" />
<filter name="group_branch" string="Branch" domain="[]"
context="{'group_by': 'is_branch'}" />
<filter name="group_state" string="State" domain="[]"
context="{'group_by': 'state'}" />
</group>
<separator />
<filter string="My Requests" name="my_request"
domain="[('employee_id.user_id', '=', uid)]" />
<separator />
</search>
</field>
</record>
<record id="action_tagwaarden_tree" model="ir.actions.act_window.view">
<field eval="1" name="sequence" />
<field name="view_mode">tree</field>
<field name="view_id" ref="employee_training_tree_view" />
<field name="act_window_id" ref="employee_training_action" />
</record>
<record id="action_tagwaarden_form" model="ir.actions.act_window.view">
<field eval="2" name="sequence" />
<field name="view_mode">form</field>
<field name="view_id" ref="employee_training_form_view" />
<field name="act_window_id" ref="employee_training_action" />
</record>
<!-- hr_job_inherit -->
<record id="view_hr_job_cours_form_inherit" model="ir.ui.view">
<field name="name">hr.job.form.cours.inherit</field>
<field name="model">hr.job</field>
<field name="priority" eval="16" />
<field name="inherit_id" ref="hr.view_hr_job_form" />
<field name="arch" type="xml">
<notebook>
<page string="Courses">
<field name="course_ids" widget="many2many" />
</page>
</notebook>
</field>
</record>
<record model="ir.ui.view" id="hr_employees_training_lines_form">
<field name="name">Employee Training Courses</field>
<field name="model">hr.official.mission.employee</field>
<field name="arch" type="xml">
<form>
<header>
<button name="approve" string="Approve"
class="oe_highlight" type="object"
attrs="{'invisible':[('status','!=','direct_manager')]}"
groups="hr_base.group_division_manager" />
<button name="refuse" string="Refuse" class="oe_highlight"
type="object"
attrs="{'invisible':[('status','!=','direct_manager')]}"
groups="hr_base.group_division_manager" />
<button name="done" string="Done" class="oe_highlight"
type="object"
attrs="{'invisible':[('status','!=','approved')]}" />
<button name="set_to_draft" string="Set to Draft"
class="oe_highlight"
type="object"
attrs="{'invisible':[('status','not in', ('done','refused'))]}" />
<field name="status" widget="statusbar"
statusbar_visible="draft,direct_manager,approved,approved2,done,refused" />
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button name="action_get_attachment_view"
class="oe_stat_button"
icon="fa-file-text-o"
type="object">
<field name="attachment_count"
widget="statinfo"
string="Attachments"
options="{'reload_on_button': true}" />
</button>
</div>
<group>
<group>
<field name="employee_id" readonly="1" />
<!-- <field name="official_mission_id"
readonly="1" string='Mission Type' />-->
<field name="official_mission_id"
readonly="1"
string='Mission Type'
context="{'form_view_ref': 'exp_official_mission.employee_training_form_view'}"
/>
<field name="days" readonly="1" />
<field name="hours" readonly="1"
widget="float_time" />
</group>
<group>
<field name="date_from" readonly="1" />
<field name="date_to" readonly="1" />
<field name="appraisal_id"
attrs="{'invisible':[('appraisal_id','=',False)]}" />
<field name="appraisal_result"
attrs="{'invisible':[('appraisal_id','=',False)]}" />
</group>
<group>
<field name="hour_from" readonly="1"
widget="float_time" />
<field name="hour_to" readonly="1"
widget="float_time" />
<field name="total_hours"
string="Total Hours" readonly="0"
widget="float_time" />
<field name="training_details" />
</group>
</group>
</sheet>
<div class="o_attachment_preview" />
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers" />
<field name="activity_ids" widget="mail_activity" />
<field name="message_ids" widget="mail_thread" />
</div>
</form>
</field>
</record>
<record model="ir.ui.view" id="hr_employees_training_lines_tree">
<field name="name">Employee Training Course</field>
<field name="model">hr.official.mission.employee</field>
<field name="arch" type="xml">
<tree string="Employee official mission Line"
decoration-info="status == 'draft'"
decoration-danger="status == 'refused'"
decoration-success="status=='approved'">
<field name="employee_id" />
<field name="official_mission_id" string='Mission Type' />
<field name="course_name" />
<field name="date_from" />
<field name="date_to" />
<field name="days" />
<field name="hour_from" widget="float_time" />
<field name="hour_to" widget="float_time" />
<field name="hours" widget="float_time" />
<field name="total_hours" widget="float_time" />
<field name="appraisal_id" invisible="1" />
<field name="appraisal_result"
attrs="{'invisible':[('appraisal_id','=',False)]}" />
<field name="status" string="Employee Status" />
<field name="state" string="Status" invisible="1" />
<field name="attachment_count" invisible="1" />
<button name="action_get_attachment_view" string="Attachments"
type="object"
icon="fa-paperclip"
attrs="{'invisible': [('attachment_count', '=', 0)]}" />
</tree>
</field>
</record>
<record id="hr_employees_training_lines_action" model="ir.actions.act_window">
<field name="name">Employees Official Mission</field>
<field name="res_model">hr.official.mission.employee</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('official_mission_id.process_type','=','training')]</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to add a Employee Training Course.
</p>
</field>
</record>
<record id="action_employees_training_lines_form" model="ir.actions.act_window.view">
<field eval="2" name="sequence" />
<field name="view_mode">form</field>
<field name="view_id" ref="hr_employees_training_lines_form" />
<field name="act_window_id" ref="hr_employees_training_lines_action" />
</record>
<record id="action_employees_training_lines_tree" model="ir.actions.act_window.view">
<field eval="1" name="sequence" />
<field name="view_mode">tree</field>
<field name="view_id" ref="hr_employees_training_lines_tree" />
<field name="act_window_id" ref="hr_employees_training_lines_action" />
</record>
</data>
</odoo>