@@ -214,10 +214,10 @@ class HrLeaveAllocation(models.Model):
|
||||
return super(HrLeaveAllocation, self).unlink()
|
||||
|
||||
|
||||
def update_vacation(self):
|
||||
leave_ids = self.env["hr.leave.allocation"].browse(
|
||||
self._context.get('active_ids', self._context.get('active_id')))
|
||||
for leave in leave_ids:
|
||||
def action_validate(self):
|
||||
result = super(HrLeaveAllocation, self).action_validate()
|
||||
|
||||
for leave in self:
|
||||
if leave.holiday_status_id.name != '年假':
|
||||
continue
|
||||
|
||||
@@ -242,6 +242,8 @@ class HrLeaveAllocation(models.Model):
|
||||
})]
|
||||
})
|
||||
reports_id.update_line()
|
||||
|
||||
return result
|
||||
|
||||
def update_employee(self):
|
||||
leave_ids = self.env["hr.leave.allocation"].browse(
|
||||
|
||||
@@ -28,10 +28,6 @@
|
||||
<xpath expr="//form" position="attributes">
|
||||
<attribute name="create">0</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//button[@name='action_refuse']" position="after">
|
||||
<button string="同步考勤数据" name="update_vacation" type="object"
|
||||
class="btn btn-secondary ml-2"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='employee_ids']" position="before">
|
||||
<field name="new_employee_holidays" invisible="holiday_type != 'employee'"/>
|
||||
<field name="holiday_month" invisible="new_employee_holidays != 'limit'"/>
|
||||
@@ -75,13 +71,6 @@
|
||||
<field name="state">code</field>
|
||||
<field name="code">action = model.action_uninstall_wizard()</field>
|
||||
</record>
|
||||
<record id="all_holiday_update_vacation" 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"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">action = model.update_vacation()</field>
|
||||
</record>
|
||||
<record id="all_one_time" model="ir.actions.server">
|
||||
<field name="name">更新结束时间</field>
|
||||
<field name="model_id" ref="hr_holidays.model_hr_leave_allocation"/>
|
||||
|
||||
Reference in New Issue
Block a user