@@ -101,10 +101,12 @@ class HrLeaveAllocation(models.Model):
|
||||
}
|
||||
|
||||
def update_employee(self):
|
||||
date = datetime(2025, 1, 1)
|
||||
leave_ids = self.env["hr.leave.allocation"].browse(
|
||||
self._context.get('active_ids', self._context.get('active_id')))
|
||||
for leave in leave_ids:
|
||||
leave.employee_id.write({'quota_issued': leave.number_of_hours_display})
|
||||
if leave.holiday_status_id.name == '年假':
|
||||
leave.date_from = date
|
||||
|
||||
# @api.model
|
||||
# def create(self, vals):
|
||||
@@ -208,13 +210,6 @@ class HrLeaveAllocation(models.Model):
|
||||
if reports_id:
|
||||
reports_id.write({'leave_ids': leave_list})
|
||||
reports_id.write({'overtime_ids': compensatory_list})
|
||||
else:
|
||||
reports_id = self.env['yuthon.vacation.reports'].create({
|
||||
'employee_id': leave.employee_id.id,
|
||||
'vacation_date': date
|
||||
})
|
||||
reports_id.write({'leave_ids': leave_list})
|
||||
reports_id.write({'overtime_ids': compensatory_list})
|
||||
|
||||
# def allocation_date(self):
|
||||
# date = datetime(2025, 1, 1)
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
<field name="state">code</field>
|
||||
<field name="code">action = model.all_refuse()</field>
|
||||
</record>
|
||||
<record id="all_holiday_update_refuse" model="ir.actions.server">
|
||||
<record id="all_holiday_update_validate" model="ir.actions.server">
|
||||
<field name="name">批量批准</field>
|
||||
<field name="model_id" ref="hr_holidays.model_hr_leave_allocation"/>
|
||||
<field name="binding_model_id" ref="hr_holidays.model_hr_leave_allocation"/>
|
||||
@@ -77,7 +77,7 @@
|
||||
<field name="code">action = model.update_vacation()</field>
|
||||
</record>
|
||||
<record id="all_update_employee" model="ir.actions.server">
|
||||
<field name="name">一次性更新</field>
|
||||
<field name="name">更新分配时间</field>
|
||||
<field name="model_id" ref="hr_holidays.model_hr_leave_allocation"/>
|
||||
<field name="binding_model_id" ref="hr_holidays.model_hr_leave_allocation"/>
|
||||
<field name="state">code</field>
|
||||
|
||||
Reference in New Issue
Block a user