[UPD] exp_official_mission
This commit is contained in:
parent
25fe007db3
commit
fcbb178b17
|
|
@ -1393,7 +1393,7 @@ msgstr ""
|
|||
#: model:ir.model.fields,field_description:exp_official_mission.field_hr_official_mission_employee__official_mission_id
|
||||
#: model:ir.ui.menu,name:exp_official_mission.employee_official_mission_menu_item
|
||||
msgid "Official Mission"
|
||||
msgstr "الانتدابات ومهام العمل"
|
||||
msgstr "الانتداب"
|
||||
|
||||
#. module: exp_official_mission
|
||||
#: model:ir.actions.act_window,name:exp_official_mission.hr_official_mission_action_hr_employee
|
||||
|
|
@ -2349,7 +2349,7 @@ msgstr ""
|
|||
#: model:ir.ui.menu,name:exp_official_mission.employee_especially_hours_menu_item
|
||||
#: model_terms:ir.ui.view,arch_db:exp_official_mission.employee_especially_hours_tree_view
|
||||
msgid "Employee Especially Hours"
|
||||
msgstr "ساعات الموظف الخاصة"
|
||||
msgstr "مهام العمل"
|
||||
|
||||
#. module: exp_official_mission
|
||||
#: model_terms:ir.ui.view,arch_db:exp_official_mission.employee_especially_hours_form_view
|
||||
|
|
|
|||
|
|
@ -488,18 +488,20 @@ class HrOfficialMission(models.Model):
|
|||
self.employee_ids.chick_not_overtime()
|
||||
self.employee_ids.compute_Training_cost_emp()
|
||||
self.employee_ids.write({'status': 'approved'})
|
||||
self.state = "direct_manager"
|
||||
self.state = 'depart_manager'
|
||||
for rec in self:
|
||||
manager = rec.sudo().employee_id.parent_id
|
||||
hr_manager = rec.sudo().employee_id.company_id.hr_manager_id
|
||||
if manager:
|
||||
if manager.user_id.id == rec.env.uid or hr_manager.user_id.id == rec.env.uid:
|
||||
rec.write({'state': 'direct_manager'})
|
||||
rec.write({'state': 'depart_manager'})
|
||||
else:
|
||||
raise exceptions.Warning(
|
||||
_("Sorry, The Approval For The Direct Manager '%s' Only OR HR Manager!")%(manager.name))
|
||||
else:
|
||||
rec.write({'state': 'direct_manager'})
|
||||
rec.write({'state': 'depart_manager'})
|
||||
if self.mission_type.approval_by == 'direct_manager':
|
||||
self.approve()
|
||||
|
||||
#Refuse For The Direct Manager Only
|
||||
def direct_manager_refused(self):
|
||||
|
|
@ -968,6 +970,7 @@ class HrOfficialMissionType(models.Model):
|
|||
('training', _('Training')),
|
||||
('others', _('others'))], 'Work Status')
|
||||
special_hours = fields.Boolean(string='Special Hours', default=False)
|
||||
approve_by = fields.Selection([('direct_manager', 'Direct Manager'), ('depart_manager', 'HR Department')], default='direct_manager', required=True)
|
||||
|
||||
@api.onchange('duration_type')
|
||||
def _change_duration_type(self):
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
<menuitem name="Employee Especially Hours" id="employee_especially_hours_menu_item"
|
||||
parent="employee_requests.employee_request_menu_item"
|
||||
action="employee_especially_hours_action"
|
||||
sequence="4"/>
|
||||
sequence="9"/>
|
||||
|
||||
<record model="ir.ui.view" id="employee_especially_hours_form_view">
|
||||
<field name="name">Employee Especially Hours</field>
|
||||
|
|
@ -31,15 +31,15 @@
|
|||
states="send" groups="hr_base.group_division_manager"/>
|
||||
|
||||
<button name="approve" string="HR Approval" class="oe_highlight" type="object"
|
||||
states="direct_manager" groups="hr.group_hr_user"/>
|
||||
states="depart_manager" groups="hr.group_hr_user"/>
|
||||
<button name="refused" string="Refused" class="oe_highlight" type="object"
|
||||
states="direct_manager" groups="hr.group_hr_user"/>
|
||||
states="depart_manager" groups="hr.group_hr_user"/>
|
||||
|
||||
<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?"/>
|
||||
<field name="state" widget="statusbar"
|
||||
statusbar_visible="draft,send,direct_manager,approve,refused"/>
|
||||
statusbar_visible="draft,send,depart_manager,approve,refused"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<group>
|
||||
|
|
@ -59,16 +59,6 @@
|
|||
|
||||
<field name="date_duration" string="Duration Days" readonly="1" force_save="1"
|
||||
attrs="{'required':[('duration_type','=','days')]}"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="company_id" groups="base.group_multi_company" attrs="{'readonly': [('state','!=', 'draft')]}"/>
|
||||
<field name="date" string="Date Request" attrs="{'readonly':[('state','!=','draft')]}"
|
||||
required="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="note" string='Comments' attrs="{'readonly':[('state','!=','draft')]}" /-->
|
||||
<field name="hour_from" string="Hour From" widget="float_time"
|
||||
attrs="{'required': [('state', '=', 'direct_manager')],
|
||||
'readonly':[('state','not in',('draft','direct_manager','send'))] }"/>
|
||||
|
|
@ -79,6 +69,22 @@
|
|||
widget="float_time"
|
||||
attrs="{'required':[('duration_type','=','hours')]}"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="company_id" groups="base.group_multi_company" attrs="{'readonly': [('state','!=', 'draft')]}"/>
|
||||
<field name="date" string="Date Request" attrs="{'readonly':[('state','!=','draft')]}"
|
||||
required="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="destination" string="Destination" widget="selection"
|
||||
domain="[('destination_type','in',('mission','all'))]" />
|
||||
<!--field name="note" string='Comments' attrs="{'readonly':[('state','!=','draft')]}" /-->
|
||||
</group>
|
||||
</group>
|
||||
<group string="Mission Purpose">
|
||||
<field name="mission_purpose" nolabel="1"
|
||||
attrs="{'readonly':[('state','!=','draft')], 'required':[('state','=','draft')]}"/>
|
||||
</group>
|
||||
|
||||
<notebook>
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@
|
|||
|
||||
<field name="max_amount" string="Maximum Amount"
|
||||
attrs="{'invisible':[('related_with_financial','=',False)],'required':[('related_with_financial','=',True)]}"/>
|
||||
<field name="approve_by"/>
|
||||
|
||||
<separator string="Accounting"
|
||||
attrs="{'invisible':[('related_with_financial','=',False)]}"/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue