添加功能
This commit is contained in:
@@ -253,6 +253,9 @@ class YuthonHrEmployee(models.Model):
|
||||
('divorced', 'Divorced')
|
||||
], string='Marital Status', groups="hr.group_hr_user", default='single', tracking=True)
|
||||
|
||||
def read_number(self):
|
||||
return self.env['hr.employee'].search_count([('end_comparison', 'in', ['red', 'yellow', 'blue'])])
|
||||
|
||||
def update_role_group_ids(self):
|
||||
employee_ids = self.env["hr.employee"].browse(
|
||||
self._context.get("active_ids", self._context.get("active_id"))
|
||||
|
||||
@@ -629,7 +629,7 @@
|
||||
<filter string="离职" name="to_do" domain="[('user_state', '=', 'leave')]"/>
|
||||
<filter string="退休" name="done" domain="[('user_state', '=', 'withdraw')]"/>
|
||||
<filter string="即将到期" name="end"
|
||||
domain="[('end_comparison', 'in', ['red', 'yellow', 'blue'])]" shownumber="1"/>
|
||||
domain="[('end_comparison', 'in', ['red', 'yellow', 'blue'])]"/>
|
||||
</quick_filter>
|
||||
</header_search>
|
||||
</xpath>
|
||||
|
||||
@@ -204,7 +204,6 @@ class YuthonNotice(models.Model):
|
||||
conf_old.write({'state': 'no'})
|
||||
|
||||
user_wecom_mapping = []
|
||||
we_id_list = []
|
||||
for user_id in self.users_ids:
|
||||
employee = self.env['hr.employee'].sudo().search(
|
||||
[('user_id', '=', user_id.id)],
|
||||
@@ -212,19 +211,10 @@ class YuthonNotice(models.Model):
|
||||
)
|
||||
if not employee:
|
||||
continue
|
||||
emp_id = employee.id
|
||||
wecom_id = employee.wecom_userid
|
||||
user_wecom_mapping.append({'emp_id': emp_id, 'user_id': user_id})
|
||||
if wecom_id:
|
||||
we_id_list.append(wecom_id)
|
||||
|
||||
msg_id = False
|
||||
touser = "|".join(we_id_list) if we_id_list else ""
|
||||
if touser:
|
||||
url = f'https://phone.thtzjt.com/phone/Notice/110?employee_id='
|
||||
url = f'https://phone.thtzjt.com/phone/Notice/110?employee_id={employee.id}'
|
||||
result_data = self.sudo().env["wecom.apps"].sync_send_message_textcard(
|
||||
category='notice',
|
||||
touser=touser,
|
||||
user_id=employee.wecom_userid,
|
||||
title="通知公告",
|
||||
description=self.name + '发布人:' + self.users_id.name,
|
||||
url=url,
|
||||
|
||||
@@ -85,6 +85,16 @@ class PropertyManagement(models.Model):
|
||||
line.information_line_id.write({'end_date': fields.Date.today()})
|
||||
# 直接从关联的上一条记录获取值(如果存在)
|
||||
prev_info = line.information_line_id
|
||||
target_start_time = record.start_time
|
||||
target_property_id = line.property_id.id
|
||||
existing_info = self.env['manage.information.line'].search([
|
||||
('yuthon_property_id', '=', target_property_id),
|
||||
('start_time', '=', target_start_time)
|
||||
], limit=1)
|
||||
# 如果已有相同start_time的记录,跳过创建
|
||||
if existing_info:
|
||||
continue
|
||||
|
||||
# 创建新的信息行记录,从prev_info获取缺失的值
|
||||
info_line_vals = {
|
||||
'yuthon_property_id': line.property_id.id,
|
||||
|
||||
@@ -433,11 +433,11 @@
|
||||
<field name="percentage_damages"/>
|
||||
<field name="total_receivable"/>
|
||||
<field name="actual_start_time"/>
|
||||
<field name="actual_end_time"/>
|
||||
<field name="term_start_time"/>
|
||||
<field name="term_end_time" decoration-info="end_comparison == 'blue'"
|
||||
<field name="actual_end_time" decoration-info="end_comparison == 'blue'"
|
||||
decoration-danger="end_comparison == 'red'"
|
||||
decoration-warning="end_comparison == 'yellow'"/>
|
||||
<field name="term_start_time"/>
|
||||
<field name="term_end_time"/>
|
||||
<field name="contract_type"/>
|
||||
<field name="contract_date"/>
|
||||
<field name="contract_signature_ids" widget="preview_many2many" invisible="not contract_date"/>
|
||||
|
||||
Reference in New Issue
Block a user