diff --git a/yuthon_hr_attendance/models/yuthon_shift_approval.py b/yuthon_hr_attendance/models/yuthon_shift_approval.py index 734bf16a7..fee8a2e52 100644 --- a/yuthon_hr_attendance/models/yuthon_shift_approval.py +++ b/yuthon_hr_attendance/models/yuthon_shift_approval.py @@ -16,8 +16,8 @@ class YuthonShiftApproval(models.Model): transferees_id = fields.Many2one('resource.resource', string="调班对象", domain="[('id', 'in', resource_ids)]") alternate_id = fields.Many2one('resource.resource', string="替班对象", domain="[('id', 'in', resource_ids)]") alternate_shifts = fields.Selection([('transferees', '调班'), ('alternate', '替班')], string="调替班" , default='transferees') - shift_start = fields.Datetime(string="开始时间") - shift_end = fields.Datetime(string="结束时间") + shift_start = fields.Datetime(string="开始日期") + shift_end = fields.Datetime(string="结束日期") shift_id = fields.Many2one('planning.slot', string="申请人1") shift_two_start = fields.Datetime(string="开始时间") shift_two_end = fields.Datetime(string="结束时间") diff --git a/yuthon_property_approval/wizard/property_rental_wizard.py b/yuthon_property_approval/wizard/property_rental_wizard.py index 110efa66b..22766eda5 100644 --- a/yuthon_property_approval/wizard/property_rental_wizard.py +++ b/yuthon_property_approval/wizard/property_rental_wizard.py @@ -36,10 +36,16 @@ class PropertyRentalWizard(models.Model): ('contract_id', '=', record.id), ], limit=1) - if existing_receivable: + if existing_receivable and record.actual_end_time <= start_date: return - else: + + receivable = self.env['property.accounts.receivable'].create({ + ('contract_id', '=', record.id), + }) + if receivable: acc_type = 'new' + else: + acc_type = None if not rent_id: self.sudo().env["property.rent.list"].create({