添加功能

This commit is contained in:
李鹏宇
2026-02-04 19:51:19 +08:00
parent 4b794d3471
commit 6842349b57
4 changed files with 23 additions and 1 deletions
@@ -460,7 +460,7 @@
<field name="type">ir.actions.act_window</field>
<field name="res_model">soong.workflow.record</field>
<field name="view_mode">tree,kanban,search</field>
<field name="domain">[('reclaim_state', '=', False), ('member_of_department', '=', True), ('is_company', '=', True)]</field>
<field name="domain">[('reclaim_state', '=', False), ('member_of_department', '=', True), ('is_company', '=', True),('approve_state','!=','start'),('approvals_group_id.name', '!=', '考勤')]</field>
<field name="context">{'search_default_my_department_shifts': True,}</field>
<field name="search_view_id" ref="soong_workflow_record_search1"/>
<field name="view_id" ref="soong_workflow_record_department_tree"/>
@@ -93,6 +93,7 @@ class CustomerPortal(portal.CustomerPortal):
'异常': format_vacation_value(record.is_abnormal, '次'),
'年假': format_vacation_value(record.done_leave, '天'),
'加班时': format_vacation_value(record.done_working_overtime, '小时', 8),
'补休': format_vacation_value(record.cop_leave, '小时', 8),
'调休': format_vacation_value(record.compensatory_leave, '天'),
'事假': format_vacation_value(record.leave_of_absence, '天'),
'加班时(法定假)': format_vacation_value(record.statutory_leave, '小时', 8),
@@ -1,6 +1,19 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<data noupdate="1">
<record forcecreate="True" id="update_vacation_task" model="ir.cron">
<field name="name">定时任务:考勤台账重新计算</field>
<field name="model_id" ref="model_yuthon_vacation_reports"/>
<field name="state">code</field>
<field name="code">model.update_vacation_task()</field>
<field eval="True" name="active"/>
<field name="user_id" ref="base.user_root"/>
<field name="interval_type">days</field>
<field name="interval_number">1</field>
<field name="nextcall" eval="(DateTime.now()).strftime('%Y-%m-%d 00:35:00')"/>
<field name="numbercall">-1</field>
<field eval="False" name="doall"/>
</record>
<record forcecreate="True" id="attendance_missing_card_judgment" model="ir.cron">
<field name="name">定时任务:考勤缺卡判断</field>
<field name="model_id" ref="model_hr_attendance"/>
@@ -109,6 +109,14 @@ class YuthonVacationReports(models.Model):
tracking=3,
default='not_sent')
def update_vacation_task(self):
today = date.today()
current_month_first = today.replace(day=1)
vacation_ids = self.search([('vacation_date', '=', current_month_first)])
for vacation in vacation_ids:
vacation.update_line()
def update_line(self):
self.manage_reject()
# ========== 第一步:处理年假逻辑 ==========