添加功能

This commit is contained in:
李鹏宇
2025-12-25 14:33:47 +08:00
parent e04616421b
commit be3ea250fb
2 changed files with 24 additions and 0 deletions
@@ -286,6 +286,28 @@ class YuthonHrEmployee(models.Model):
else:
record.date_end = None
def renew(self):
employee_ids = self.env["hr.employee"].browse(
self._context.get("active_ids", self._context.get("active_id"))
)
for record in employee_ids:
if len(record) > 1:
raise UserError("只能选择一个员工续签")
return {
"name": "续签",
"type": "ir.actions.act_window",
"res_model": "yuthon.renewal.approval",
"view_mode": "form",
"context": {
"default_employee_id": self.employee_id.id,
"default_current_status": self.employee_id.contract_id.date_end,
"default_department1_id": self.employee_id.department_id.id,
"default_contract_id": self.employee_id.contract_id.id,
},
}
def update_social_base(self):
current_year = fields.Date.today().year
group_company = self.env['res.company'].search([('name', '=', '集团本部')], limit=1)
@@ -538,6 +538,8 @@ class PropertyReconciliationWizard(models.Model):
]
# 检查是否已有相同记录
existing_record = self.env['property.accounts.receivable'].search(check_domain)
if len(existing_record)>1:
raise UserError(f'合同{line.contract_id.contract_code}应收日期为{line.due_date}的违约金存在多条相同记录,请检查数据')
is_reconciliation = round(line.amount,2) == round(line.rent, 2)
receivable_id = self.env['property.accounts.receivable']
if not existing_record and is_create: