@@ -114,6 +114,7 @@ class OvertimeApprovals(models.Model):
|
||||
@api.depends('start_time', 'end_time', 'attendance_id', 'rest_start_time', 'rest_end_time')
|
||||
def _compute_duration(self):
|
||||
for rec in self:
|
||||
max_hours = 99
|
||||
rec.duration = 0.0
|
||||
rec.overtime_hours = 0.0
|
||||
if not (rec.start_time and rec.end_time):
|
||||
@@ -150,8 +151,9 @@ class OvertimeApprovals(models.Model):
|
||||
else:
|
||||
rec.duration = calculated_hours
|
||||
|
||||
if rec.rest_end_time and rec.rest_end_time:
|
||||
rec.duration -= (rec.rest_end_time - rec.c).total_seconds() / 3600
|
||||
if rec.rest_end_time and rec.rest_start_time:
|
||||
calculated_hours -= (rec.rest_end_time - rec.rest_start_time).total_seconds() / 3600
|
||||
rec.duration = min(calculated_hours, max_hours)
|
||||
|
||||
employee = rec.users_id.employee_id
|
||||
if not employee:
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
<group/>
|
||||
</group>
|
||||
<group col="2" string="加班信息">
|
||||
<field name="type_overtime"/>
|
||||
<group>
|
||||
<label for="start_time"/>
|
||||
<div class="d-inline-flex w-100">
|
||||
@@ -83,7 +84,6 @@
|
||||
<group>
|
||||
<field name="rest_start_time"/>
|
||||
<field name="rest_end_time"/>
|
||||
<field name="type_overtime"/>
|
||||
</group>
|
||||
<group/>
|
||||
</group>
|
||||
|
||||
@@ -178,8 +178,8 @@ class PropertyLeaseRenewal(models.Model):
|
||||
})
|
||||
else:
|
||||
receivable_ids = self.env['property.accounts.receivable'].search([
|
||||
('due_date', '<=', self.early_quitting_date),
|
||||
('contract_id', '=', self.contract_id.id),
|
||||
('due_date', '<=', rec.early_quitting_date),
|
||||
('contract_id', '=', rec.contract_id.id),
|
||||
])
|
||||
if any(not receivable.is_reconciliation for receivable in receivable_ids):
|
||||
raise UserError("该合同下存在未对账的应收单,无法提前退押金")
|
||||
|
||||
Reference in New Issue
Block a user