添加功能
This commit is contained in:
@@ -223,9 +223,9 @@ class HrLeaveAllocation(models.Model):
|
||||
'vacation_date': date
|
||||
})
|
||||
|
||||
reports_id.write({'leave_ids': leave_list})
|
||||
reports_id.write({'overtime_ids': compensatory_list})
|
||||
reports_id.write({'other_fee_ids': other_list})
|
||||
reports_id.write({'leave_ids': [(5, 0, 0)] + leave_list})
|
||||
reports_id.write({'overtime_ids': [(5, 0, 0)] + compensatory_list})
|
||||
reports_id.write({'other_fee_ids': [(5, 0, 0)] + other_list})
|
||||
# def allocation_date(self):
|
||||
# date = datetime(2025, 1, 1)
|
||||
# leave_id = self.env['hr.leave.allocation'].search([])
|
||||
|
||||
@@ -185,8 +185,22 @@ class PropertyRentalWizard(models.Model):
|
||||
adjusted_day = min(start_day, max_day)
|
||||
date_str = f"{date_field_year_month}-{adjusted_day}"
|
||||
start_date = datetime.strptime(date_str, "%Y-%m-%d").date()
|
||||
# 判断是否是最新合同版本
|
||||
new_version = True
|
||||
all_versions = self.env['property.lease.contract'].search([
|
||||
('contract_code', '=', record.contract_code)
|
||||
])
|
||||
if all_versions:
|
||||
version_info = []
|
||||
for ver in all_versions:
|
||||
version_num = float(ver.version.lstrip('Vv'))
|
||||
version_info.append((ver.id, version_num))
|
||||
max_version_id = max(version_info, key=lambda x: x[1])[0]
|
||||
if record.id != max_version_id:
|
||||
new_version = False
|
||||
|
||||
# 当期应收日期
|
||||
if not record.is_contract:
|
||||
if not record.is_contract and new_version:
|
||||
if start_year_month <= date_field_year_month <= end_year_month:
|
||||
if rent_id.period_rent != 0 and record.contract_sort not in ['guanggao', 'guanzi', 'room']:
|
||||
self.create_rent_list(record, rent_id, rent_amount, start_date, multiplier)
|
||||
@@ -211,6 +225,7 @@ class PropertyRentalWizard(models.Model):
|
||||
records = self.env['property.lease.contract'].search([
|
||||
('actual_start_time', '<', next_month_first_day),
|
||||
('actual_end_time', '>=', first_day),
|
||||
('state', '=', 'done')
|
||||
])
|
||||
for record in records:
|
||||
# 获取租金乘数(1 表示按月,3 表示季租金,6 表示半年租金,年后面赋值)
|
||||
|
||||
Reference in New Issue
Block a user