Merge pull request !11801 from 李鹏宇/dev
This commit is contained in:
李鹏宇
2026-05-31 07:15:19 +00:00
committed by Gitee
5 changed files with 44 additions and 6 deletions
@@ -856,9 +856,16 @@ class SoongWorkflowRecord(models.Model):
def to_do_process_reminders(self):
workflow_records = self.env['soong.workflow.record'].search([
('approve_state', '=', 'pending'),
('reclaim_state', '=', False),
('employee_ids', '!=', False)
])
employee_tasks = {}
# 只统计 叶华锋 一个人的任务
target_employee = self.env['hr.employee'].search([('name', '=', '叶华锋')], limit=1)
if not target_employee:
return # 找不到人直接退出
for record in workflow_records:
try:
biz_record = self.env[record.res_model].browse(record.res_id)
@@ -868,7 +875,11 @@ class SoongWorkflowRecord(models.Model):
urgency_level = 'normal'
task_type = 'urgent' if urgency_level in ('urgent', 'emergency') else 'normal'
# 只处理叶华锋
for emp in record.employee_ids:
if emp.id != target_employee.id:
continue # 不是叶华锋直接跳过
emp_id = emp.id
if emp_id not in employee_tasks:
employee_tasks[emp_id] = {'urgent': 0, 'normal': 0, 'employee': emp}
@@ -878,6 +889,7 @@ class SoongWorkflowRecord(models.Model):
if "记录不存在或已删除" in error_msg:
continue
# 只给叶华锋发消息
for emp_id, task_data in employee_tasks.items():
emp = task_data['employee']
urgent_count = task_data['urgent']
@@ -137,4 +137,11 @@ class ResourceCalendarLeave(models.Model):
holidays = fields.Text(string="法定日")
alternate_rest_day = fields.Text(string='调休休息日')
shift_replacement_day = fields.Text(string='调班补班日')
total_days = fields.Integer(string='总天数')
total_days = fields.Integer(string='总天数')
@api.model
def default_get(self, fields_list):
res = super().default_get(fields_list)
if 'company_id' in fields_list:
res['company_id'] = False
return res
@@ -87,6 +87,9 @@
<field name="model">resource.calendar.leaves</field>
<field name="inherit_id" ref="resource.resource_calendar_leave_tree"/>
<field name="arch" type="xml">
<xpath expr="//tree/field[@name='company_id']" position="attributes">
<attribute name="column_invisible">True</attribute>
</xpath>
<xpath expr="//tree/field[@name='date_to']" position="after">
<field name="alternate_rest_day"/>
<field name="holidays"/>
@@ -106,6 +109,9 @@
<field name="model">resource.calendar.leaves</field>
<field name="inherit_id" ref="resource.resource_calendar_leave_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='company_id'][@groups='base.group_multi_company']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='date_to']" position="after">
<field name="alternate_rest_day"/>
<field name="holidays"/>
@@ -119,4 +125,17 @@
<field name="res_model">resource.calendar.leaves</field>
<field name="view_mode">tree,form</field>
</record>
<record id="inherit_resource_calendar_leaves_search" model="ir.ui.view">
<field name="name">resource.calendar.leaves.search.inherit</field>
<field name="model">resource.calendar.leaves</field>
<field name="inherit_id" ref="resource.view_resource_calendar_leaves_search"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='company_id']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//filter[@name='company']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
</field>
</record>
</odoo>
@@ -7,10 +7,10 @@
<tree string="公告确认信息" js_class="custom_notice_tree_button" editable="bottom">
<header>
<button name="reminders_notice" string="批量催办" type="object" class="oe_stat_button" icon="fa-bars"/>
<button name="all_withdrawn" string="批量撤回" type="object" icon="fa-bars" lass="oe_stat_button" confirm="确认要撤回吗?"/>
<button name="reminders_notice_send" string="批量发送" type="object" icon="fa-bars" lass="oe_stat_button"/>
<button name="all_withdrawn" string="批量撤回" type="object" icon="fa-bars" class="oe_stat_button" confirm="确认要撤回吗?"/>
<button name="reminders_notice_send" string="批量发送" type="object" icon="fa-bars" class="oe_stat_button"/>
</header>
<field name="employee_id" widget="ztree_select"/>
<field name="employee_id"/>
<field name="employee_number" column_invisible="1"/>
<field name="company_id" readonly="1"/>
<field name="department_id" readonly="1"/>
@@ -43,4 +43,4 @@
<field name="view_mode">tree</field>
</record>
</odoo>
</odoo>
@@ -685,7 +685,7 @@
<xpath expr="//tree" position="inside">
<header>
<!-- <button name="unbind" type="object" class="btn btn-primary" string="取消绑定"/>-->
<button name="update_property_employee_id" type="object" class="oe_highlight" string="更新合同"/>
<button name="update_property_employee_id" type="object" class="oe_highlight" string="重新计算"/>
<button name="other" type="object" class="oe_highlight" string="其他"/>
</header>
</xpath>