@@ -235,7 +235,7 @@ class OvertimeApprovals(models.Model):
|
||||
raise UserError("开始时间不能晚于结束时间")
|
||||
start_date = fields.Datetime.from_string(record.start_time)
|
||||
end_date = fields.Datetime.from_string(record.end_time)
|
||||
public_holidays = self.env['resource.calendar.leaves'].search([])
|
||||
public_holidays = self.env['resource.calendar.leaves'].search([("calendar_id", "=", "行政考勤工作日")])
|
||||
for holiday in public_holidays:
|
||||
holiday_start = fields.Datetime.from_string(holiday.date_from)
|
||||
holiday_end = fields.Datetime.from_string(holiday.date_to)
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
<group>
|
||||
<field name="start_time" options="{'rounding': 0}"/>
|
||||
<field name="end_time" options="{'rounding': 0}"/>
|
||||
<field name="type_overtime"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="start_week" string=" "/>
|
||||
@@ -76,7 +77,6 @@
|
||||
<field name="employee_ids" widget="many2many_tags" options="{'no_create': True}"/>
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="overtime_hours" readonly="1"/>
|
||||
<field name="type_overtime"/>
|
||||
<field name="meal" required="1"/>
|
||||
</group>
|
||||
</sheet>
|
||||
|
||||
@@ -623,19 +623,20 @@ class PropertyRentList(models.Model):
|
||||
else:
|
||||
due_date_end = fields.Date.to_string(theoretical_end)
|
||||
|
||||
# 创建应收记录
|
||||
self.env['property.accounts.receivable'].create({
|
||||
'contract_id': contract.id if contract else None,
|
||||
'property_id': rec.property_id.id,
|
||||
'lessee_id': contract.lessee_id.id if contract and contract.lessee_id else None,
|
||||
'original_amount': rec.original_amount,
|
||||
'due_date': due_date,
|
||||
'due_date_end': due_date_end,
|
||||
'create_time': datetime.now(),
|
||||
'management_type_id': management_type.id,
|
||||
})
|
||||
rec.is_push = True
|
||||
self.reconcile_with_bank_statements(rec)
|
||||
# 创建应收记录
|
||||
self.env['property.accounts.receivable'].create({
|
||||
'contract_id': contract.id if contract else None,
|
||||
'property_id': rec.property_id.id,
|
||||
'lessee_id': contract.lessee_id.id if contract and contract.lessee_id else None,
|
||||
'original_amount': rec.original_amount,
|
||||
'due_date': due_date,
|
||||
'due_date_end': due_date_end,
|
||||
'create_time': datetime.now(),
|
||||
'management_type_id': management_type.id,
|
||||
})
|
||||
|
||||
rec.is_push = True
|
||||
self.reconcile_with_bank_statements(rec)
|
||||
|
||||
def reconcile_with_bank_statements(self, rec):
|
||||
bank_accounts = self.env['property.bank.line'].search([
|
||||
|
||||
Reference in New Issue
Block a user