commit
1cb38acc75
|
|
@ -30,7 +30,6 @@ class HRHolidays(models.Model):
|
|||
start_date = fields.Date(string="Start Date", default=fields.Datetime.now())
|
||||
end_date = fields.Date(string="End Date")
|
||||
notes = fields.Text()
|
||||
reject_reason = fields.Text(string='Reject Reason')
|
||||
issuing_exit_return = fields.Selection(selection=[('yes', _('Yes')), ('no', _('No'))], default='no')
|
||||
check_allocation_view = fields.Selection(selection=[('allocation', _('Allocation')), ('balance', _('Balance'))])
|
||||
exit_return_duration = fields.Float(related='number_of_days_temp')
|
||||
|
|
@ -1183,22 +1182,8 @@ class HRHolidays(models.Model):
|
|||
else:
|
||||
balance.write({'remaining_leaves': balance.remaining_leaves - allocation.number_of_days_temp, })
|
||||
|
||||
def refuse(self):
|
||||
action_name = _('Specify Reject Reason')
|
||||
reject_reason = self.env.context.get('reject_reason')
|
||||
if reject_reason:
|
||||
return self.action_refuse(reject_reason)
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': action_name,
|
||||
'res_model': 'hr.reject.wizard',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'target': 'new',
|
||||
'context': {'default_origin': self.id, 'default_origin_name': self._name}
|
||||
}
|
||||
|
||||
def action_refuse(self,reject_reason=""):
|
||||
def refuse(self):
|
||||
for item in self:
|
||||
have_cancel_request = self.env['leave.cancellation'].search(
|
||||
[('leave_request_id', '=', item.id), ('state', 'not in', ('draft', 'refuse'))])
|
||||
|
|
@ -1228,7 +1213,7 @@ class HRHolidays(models.Model):
|
|||
item.remove_delegated_access()
|
||||
item.call_cron_function()
|
||||
self.check_allocation_balance_annual('addition')
|
||||
item.write({'state': 'refuse','reject_reason':reject_reason})
|
||||
item.write({'state': 'refuse'})
|
||||
|
||||
@api.onchange('holiday_status_id')
|
||||
def _get_holiday_related_date(self):
|
||||
|
|
|
|||
|
|
@ -112,9 +112,7 @@
|
|||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Reject Reason" name="reject_reason" attrs="{'invisible':[('reject_reason','=',False)]}">
|
||||
<field name="reject_reason" string="Reject Reason" readonly="1"/>
|
||||
</page>
|
||||
|
||||
</notebook>
|
||||
</xpath>
|
||||
<header position="replace">
|
||||
|
|
|
|||
Loading…
Reference in New Issue