diff --git a/yuthon_holiday/views/hr_leave_batch.xml b/yuthon_holiday/views/hr_leave_batch.xml
index 6b2471a46..b271b1773 100644
--- a/yuthon_holiday/views/hr_leave_batch.xml
+++ b/yuthon_holiday/views/hr_leave_batch.xml
@@ -39,14 +39,9 @@
-
-
-
-
-
-
+
diff --git a/yuthon_property_approval/models/property_lease_renewal.py b/yuthon_property_approval/models/property_lease_renewal.py
index eeb1b4f50..5880ae057 100644
--- a/yuthon_property_approval/models/property_lease_renewal.py
+++ b/yuthon_property_approval/models/property_lease_renewal.py
@@ -11,7 +11,6 @@ class PropertyLeaseRenewal(models.Model):
_rec_name = 'name'
name = fields.Char(string='标题')
- reason_application = fields.Text(string="申请事由")
user_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user)
department_id = fields.Many2one(related='user_id.department_id', string="部门")
company_id = fields.Many2one(related='user_id.company_id', string="公司")
@@ -87,5 +86,15 @@ class PropertyLeaseRenewal(models.Model):
'actual_end_time': rec.early_quitting_date})
rec.hide = True
+ @api.onchange('contract_id', 'renewal_type')
+ def _onchange_name(self):
+ if self.contract_id and self.renewal_type:
+ renewal_type_text = dict(self._fields['renewal_type'].selection).get(self.renewal_type, '')
+ self.name = f"{self.contract_id.name} + {renewal_type_text}"
+ elif self.contract_id:
+ self.name = self.contract_id.property_name
+ else:
+ self.name = False
+
class PropertyEarlyQuitting(models.Model):
_name = 'property.early.quitting'
diff --git a/yuthon_property_approval/views/property_lease_renewal.xml b/yuthon_property_approval/views/property_lease_renewal.xml
index 39d548a86..aeb553893 100644
--- a/yuthon_property_approval/views/property_lease_renewal.xml
+++ b/yuthon_property_approval/views/property_lease_renewal.xml
@@ -39,7 +39,6 @@
-
diff --git a/yuthon_property_approval/wizard/property_rental_wizard.py b/yuthon_property_approval/wizard/property_rental_wizard.py
index ba89fc32b..a4f9326e8 100644
--- a/yuthon_property_approval/wizard/property_rental_wizard.py
+++ b/yuthon_property_approval/wizard/property_rental_wizard.py
@@ -214,13 +214,25 @@ class PropertyRentalWizard(models.Model):
date_field = datetime(year, month, 1).date()
date_field_year_month = date_field.strftime('%Y-%m')
# 获取当月第一天和最后一天
- first_day = datetime.strptime(date_field_year_month, '%Y-%m').date() # 当月第一天
- last_day = (first_day + relativedelta(months=1, days=-1)) # 当月最后一天
+ first_day = datetime.strptime(date_field_year_month, '%Y-%m').date()
+ last_day = first_day + relativedelta(months=1) - relativedelta(days=1)
records = self.env['property.lease.contract'].search([
('actual_start_time', '<=', last_day),
('actual_end_time', '>=', first_day),
+ ('contract_code', '=', 'SWZ2020-001')
])
- for record in records:
+ filtered_records = [
+ rec for rec in records
+ if not (
+ rec.cycle_mode == 'fixed_monthly'
+ # 条件2:实际开始日期的日是1号
+ and getattr(rec.actual_start_time, 'day', None) != 1
+ # 条件3:实际结束日期的年月等于目标年月
+ and getattr(rec.actual_end_time, 'year', None) == year
+ and getattr(rec.actual_end_time, 'month', None) == month
+ )
+ ]
+ for record in filtered_records:
date_data = {
'five': 5,
'fifteen': 15,