@@ -16,10 +16,7 @@ class SoongWorkflowRecord(models.Model):
|
||||
|
||||
def get_workflow_count(self):
|
||||
domain = [
|
||||
('soong_state', 'in', ['to_do', 'active']),
|
||||
('employee_ids.user_id', '=', self.env.user.id),
|
||||
('users_ids', 'in', self.env.user.id),
|
||||
('reclaim_state', '=', False)
|
||||
('is_to_do', '=', True),
|
||||
]
|
||||
return self.search_count(domain)
|
||||
|
||||
@@ -74,6 +71,43 @@ class SoongWorkflowRecord(models.Model):
|
||||
# 人力资源流程的发生日期
|
||||
workflow_happen_date = fields.Date(string="发生日期")
|
||||
is_unlink = fields.Boolean(string="是否可删", compute='_compute_is_unlink')
|
||||
is_to_do = fields.Boolean(
|
||||
string="是否是待办流程",
|
||||
compute='_compute_is_to_do',
|
||||
search='_search_is_to_do',
|
||||
)
|
||||
@api.depends('employee_ids', 'soong_state', 'reclaim_state')
|
||||
def _compute_is_to_do(self):
|
||||
current_uid = self.env.user.id
|
||||
for record in self:
|
||||
record.is_to_do = False
|
||||
condition1 = record.soong_state == 'to_do'
|
||||
condition2 = not record.reclaim_state
|
||||
condition3 = False
|
||||
if record.employee_ids:
|
||||
condition3 = current_uid in record.employee_ids.mapped('user_id.id')
|
||||
if condition1 and condition2 and condition3:
|
||||
record.is_to_do = True
|
||||
|
||||
def _search_is_to_do(self, operator, value):
|
||||
current_uid = self.env.user.id
|
||||
current_employee_ids = self.env['hr.employee'].search([
|
||||
('user_id', '=', current_uid)
|
||||
]).ids
|
||||
base_domain = [
|
||||
('soong_state', '=', 'to_do'),
|
||||
('reclaim_state', '=', False),
|
||||
('employee_ids', 'in', current_employee_ids)
|
||||
]
|
||||
if (operator == '=' and value) or (operator == '!=' and not value):
|
||||
domain = base_domain
|
||||
elif (operator == '=' and not value) or (operator == '!=' and value):
|
||||
domain = ['!'] + base_domain
|
||||
else:
|
||||
domain = []
|
||||
return domain
|
||||
|
||||
|
||||
|
||||
@api.depends_context('uid', 'company')
|
||||
@api.depends('department_id', 'employee_ids')
|
||||
|
||||
@@ -317,7 +317,7 @@
|
||||
<field name="res_model">soong.workflow.record</field>
|
||||
<field name="view_mode">tree,kanban,search</field>
|
||||
<field name="context">{'header_search_default_approve_state': 1, 'header_search_default_to_do':1, 'check_employee': 1}</field>
|
||||
<field name="domain">[('users_ids', 'in', uid), ('reclaim_state', '=', False), ('soong_state', 'in', ['to_do', 'to_active'])]</field>
|
||||
<field name="domain">[('is_to_do', '=', True)]</field>
|
||||
<field name="search_view_id" ref="soong_workflow_record_search1"/>
|
||||
<field name="view_id" ref="soong_workflow_record_my_tree"/>
|
||||
</record>
|
||||
|
||||
@@ -450,10 +450,10 @@ class SoongWorkflowCommentWizard(models.TransientModel):
|
||||
for employee in self.employee_ids:
|
||||
action_id = self.env['ir.actions.act_window'].search([('res_model', '=', self.res_model)])[0]
|
||||
target_url = f'https://oa.thtzjt.com/web#id={record_id.id}&cids=2&active_id={action_id.id}&model={record_id._name}&view_type=form'
|
||||
url = self.sudo().env["wecom.apps"].generate_oauth_login_url(target_url, category='oa')
|
||||
url = self.sudo().env["wecom.apps"].generate_oauth_login_url(target_url, employee.user_id.id)
|
||||
_logger.info(f"===================当前的url为{url}=============================")
|
||||
result_data = self.sudo().env["wecom.apps"].sync_send_message_textcard(category='oa',
|
||||
user_id=employee.wecom_userid,
|
||||
user_id='18562027762',
|
||||
title= record_id._description if 'Purchase Order' != record_id._description else '采购订单',
|
||||
description="标题: {}\n".format(record_id.name) + self.env.user.name + ' ' + str(
|
||||
fields.Datetime.now() + timedelta(hours=8)),
|
||||
@@ -695,7 +695,7 @@ class SoongWorkflowCommentWizard(models.TransientModel):
|
||||
recipients = [emp for emp in employees]
|
||||
for employee in recipients:
|
||||
target_url = f'https://oa.thtzjt.com/web#id={record_id.id}&cids=2&active_id={action_id.id}&model={record_id._name}&view_type=form'
|
||||
url = self.sudo().env["wecom.apps"].generate_oauth_login_url(target_url, category='oa')
|
||||
url = self.sudo().env["wecom.apps"].generate_oauth_login_url(target_url)
|
||||
if self.res_model == 'purchase.order':
|
||||
self.sudo().env["wecom.apps"].sync_send_message_textcard(category='oa',
|
||||
user_id=employee.wecom_userid,
|
||||
@@ -716,7 +716,7 @@ class SoongWorkflowCommentWizard(models.TransientModel):
|
||||
workflow_record_id = self.env['soong.workflow.record'].search([('code', '=', record_id.code)])
|
||||
action_id = self.env['ir.actions.act_window'].search([('res_model', '=', self.res_model)])[0]
|
||||
target_url = f'https://oa.thtzjt.com/web#id={record_id.id}&cids=2&menu_id={menu_id.id}&active_id={action_id.id}&model={record_id._name}&view_type=form'
|
||||
url = self.sudo().env["wecom.apps"].generate_oauth_login_url(target_url, category='oa')
|
||||
url = self.sudo().env["wecom.apps"].generate_oauth_login_url(target_url)
|
||||
description = "标题: {}\n".format(record_id.name) + self.env.user.name + ' ' + str(fields.Datetime.now() + timedelta(hours=8))
|
||||
if self.employee_ids:
|
||||
workflow_record_id.users_ids = [(4, employee.user_id.id) for employee in self.employee_ids if employee.user_id]
|
||||
@@ -839,7 +839,7 @@ class SoongWorkflowCommentWizard(models.TransientModel):
|
||||
menu_id = self.env['ir.ui.menu'].search([('name', '=', '行政收文')])
|
||||
action_id = self.env['ir.actions.act_window'].search([('res_model', '=', self.res_model)])[0]
|
||||
target_url = f'https://oa.thtzjt.com/web#id={record_id.id}&cids=2&menu_id={menu_id.id}&active_id={action_id.id}&model={record_id._name}&view_type=form'
|
||||
url = self.sudo().env["wecom.apps"].generate_oauth_login_url(target_url, category='oa')
|
||||
url = self.sudo().env["wecom.apps"].generate_oauth_login_url(target_url)
|
||||
description = "标题: {}\n".format(record_id.name) + self.env.user.name + ' ' + str(fields.Datetime.now() + timedelta(hours=8))
|
||||
record = self.env[self.res_model].search([('id', '=', self.res_id)])
|
||||
record.log_ids[-1].write({'is_active_operate': True,
|
||||
|
||||
@@ -553,6 +553,32 @@ class HolidaysRequestBatch(models.Model):
|
||||
'text': f"请假审批"
|
||||
})
|
||||
|
||||
overtime_records = self.env['vacation.over.line'].search([
|
||||
('employee_id', '=', self.users_id.employee_ids.id),
|
||||
('remaining_quantity', '>', 0),
|
||||
('is_void', '=', False),
|
||||
('text', '!=', '上月继承额度'),
|
||||
], order='start_time ASC')
|
||||
|
||||
remaining_deduct = hours
|
||||
for record in overtime_records:
|
||||
if remaining_deduct <= 0:
|
||||
break
|
||||
current_remaining = record.remaining_quantity
|
||||
deduct_amount = min(remaining_deduct, current_remaining)
|
||||
if remaining_deduct > current_remaining:
|
||||
carry_state = 'partial'
|
||||
else:
|
||||
carry_state = 'completed'
|
||||
|
||||
record.write({
|
||||
'carry_forward_date': fields.Date.to_string(period_start),
|
||||
'carry_forward_quantity': deduct_amount,
|
||||
'carry_forward_state': carry_state,
|
||||
})
|
||||
remaining_deduct -= deduct_amount
|
||||
|
||||
|
||||
def _create_annual_leave_line(self, period_start, leave_data, hours, period):
|
||||
"""更新年假记录,使用小时作为单位(增加重复校验,避免重复创建)"""
|
||||
report_month = date(period_start.year, period_start.month, 1)
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
'views/hr_attendance_portal_templates.xml',
|
||||
'views/meal_approval.xml',
|
||||
'views/applet_address_views.xml',
|
||||
# 'views/yuthon_holiday_statement.xml',
|
||||
'views/yuthon_holiday_statement.xml',
|
||||
'views/all_attendance_menu.xml',
|
||||
'views/overtime_approval_inherit_header.xml',
|
||||
|
||||
|
||||
@@ -48,18 +48,6 @@ class OvertimeApprovals(models.Model):
|
||||
work_end = fields.Boolean(string="结束")
|
||||
is_over = fields.Boolean(string="超过", compute="_compute_duration")
|
||||
|
||||
carry_forward_date = fields.Date(string="结转日期")
|
||||
carry_forward_duration = fields.Float(string="结转时长")
|
||||
carry_forward_result = fields.Selection([('success', '成功'),('failed', '失败')], string='结转结果',)
|
||||
validity = fields.Char(string="有效期")
|
||||
carry_forward_state = fields.Selection([('pending', '待结转'),('completed', '已结转'), ('partial', '部分结转')
|
||||
],string='结转状态',
|
||||
default='pending',
|
||||
)
|
||||
remaining_quantity = fields.Float(string='剩余数')
|
||||
|
||||
|
||||
|
||||
def action_print_overtime(self):
|
||||
self.ensure_one()
|
||||
return self.env.ref('yuthon_hr_attendance.action_overtime_approval_print').report_action(self)
|
||||
|
||||
@@ -2,24 +2,45 @@ from odoo import api, fields, models, tools, _
|
||||
from datetime import datetime, time, timedelta
|
||||
from odoo.exceptions import UserError
|
||||
from datetime import date, timedelta
|
||||
|
||||
class HolidayStatement(models.Model):
|
||||
class YuthonOvertimeReport(models.Model):
|
||||
_name = 'yuthon.holiday.statement'
|
||||
|
||||
class InheritHrLeave(models.Model):
|
||||
_inherit = 'hr.leave'
|
||||
_description = '请假情况'
|
||||
|
||||
leave_approval_type = fields.Char(string="审批类型")
|
||||
gender = fields.Selection([('male', '男'),('female', '女'),], string='性别', required=True, default='male')
|
||||
leave_title = fields.Char(string="标题")
|
||||
leave_summary = fields.Char(string="摘要")
|
||||
caption = fields.Char(string="标题", compute="_compute_application_reason")
|
||||
employee_id = fields.Many2one('hr.employee', string="发起人")
|
||||
leave_start_date = fields.Char(string="开始时间")
|
||||
leave_end_date = fields.Char(string="结束时间")
|
||||
leave_duration = fields.Char(string="请假时长")
|
||||
leave_stats = fields.Char(string="请假统计")
|
||||
application_reason = fields.Char(string="申请原因")
|
||||
leave_start_time = fields.Datetime(string="发起时间")
|
||||
leave_end_time = fields.Datetime(string="最后操作时间")
|
||||
approval_state = fields.Selection([
|
||||
('approved', '通过'),
|
||||
('rejected', '未通过')
|
||||
], string='审批状态')
|
||||
leave_stats = fields.Char(string="请假统计", compute="_compute_leave_stats")
|
||||
application_reason = fields.Char(string="申请原因", compute="_compute_application_reason")
|
||||
|
||||
@api.depends('batch_id', 'hour_batch_id')
|
||||
def _compute_application_reason(self):
|
||||
for rec in self:
|
||||
if rec.batch_id:
|
||||
rec.application_reason = rec.batch_id.text
|
||||
rec.caption = rec.batch_id.name
|
||||
elif rec.hour_batch_id:
|
||||
rec.application_reason = rec.hour_batch_id.text
|
||||
rec.caption = rec.hour_batch_id.name
|
||||
else:
|
||||
rec.application_reason = ''
|
||||
rec.caption = ''
|
||||
|
||||
@api.depends('holiday_status_id', 'employee_id')
|
||||
def _compute_leave_stats(self):
|
||||
for record in self:
|
||||
record.leave_stats = ""
|
||||
current_year = datetime.now().year
|
||||
start_of_year = f"{current_year}-01-01"
|
||||
end_of_year = f"{current_year}-12-31"
|
||||
leave_records = self.env['hr.leave'].search([
|
||||
('employee_id', '=', record.employee_id.id),
|
||||
('holiday_status_id', '=', record.holiday_status_id.id),
|
||||
('date_from', '>=', start_of_year),
|
||||
('date_from', '<=', end_of_year),
|
||||
('state', '=', 'validate'),
|
||||
])
|
||||
total_days = sum(leave.number_of_days for leave in leave_records)
|
||||
leave_type_name = record.holiday_status_id.name
|
||||
record.leave_stats = f"本年内已请{leave_type_name}{total_days:.1f}天"
|
||||
@@ -1,34 +0,0 @@
|
||||
from odoo import api, fields, models, tools, _
|
||||
from datetime import datetime, time, timedelta
|
||||
from odoo.exceptions import UserError
|
||||
from datetime import date, timedelta
|
||||
|
||||
|
||||
class YuthonOvertimeReport(models.Model):
|
||||
_name = 'yuthon.overtime.report'
|
||||
_description = '加班情况'
|
||||
|
||||
employee_id = fields.Many2one('hr.employee', string="员工")
|
||||
department_id = fields.Many2one('hr.department',string="部门")
|
||||
overtime_date = fields.Char(string="加班时间")
|
||||
carry_forward_date = fields.Date(string="结转日期")
|
||||
carry_forward_duration = fields.Float(string="结转时长")
|
||||
carry_forward_result = fields.Selection(
|
||||
selection=[
|
||||
('success', '成功'),
|
||||
('failed', '失败')
|
||||
],
|
||||
string='结转结果',
|
||||
)
|
||||
validity = fields.Char(string="有效期")
|
||||
carry_forward_state = fields.Selection(
|
||||
selection=[
|
||||
('pending', '待结转'),
|
||||
('completed', '已结转'),
|
||||
('partial', '部分结转')
|
||||
],
|
||||
string='结转状态',
|
||||
default='pending',
|
||||
)
|
||||
remaining_quantity = fields.Float(string='剩余数')
|
||||
|
||||
@@ -86,7 +86,6 @@ class YuthonVacationReports(models.Model):
|
||||
attendance_message_log_ids = fields.One2many('attendance.message.log', 'vacation_id')
|
||||
admin_confirms = fields.Boolean(string="是否管理员确认")
|
||||
|
||||
|
||||
vacation_state = fields.Selection(
|
||||
selection=[
|
||||
('not_sent', "未发送"),
|
||||
@@ -931,7 +930,8 @@ class VacationOverline(models.Model):
|
||||
_description = '加班明细'
|
||||
|
||||
vacation_id = fields.Many2one('yuthon.vacation.reports', string='关联假期额度记录')
|
||||
employee_id = fields.Many2one('hr.employee', string='员工')
|
||||
employee_id = fields.Many2one('hr.employee', string='员工', compute='_compute_employee_id', store=True)
|
||||
department_id = fields.Many2one('hr.department', related='employee_id.department_id', string="部门")
|
||||
workflow_record_id = fields.Many2one('soong.workflow.record', string='流程')
|
||||
update_type= fields.Selection([('add', '增加'), ('reduce', '减少')], string='更新类型')
|
||||
workday = fields.Float(string='工作日')
|
||||
@@ -947,6 +947,57 @@ class VacationOverline(models.Model):
|
||||
text = fields.Text(string='备注')
|
||||
is_confirm = fields.Boolean(string="是否确认")
|
||||
|
||||
overtime_name = fields.Char(string="标题", compute="_compute_overtime", store=True)
|
||||
start_time = fields.Datetime(string="开始时间", compute="_compute_overtime", store=True)
|
||||
end_time = fields.Datetime(string="结束时间", compute="_compute_overtime", store=True)
|
||||
carry_forward_date = fields.Date(string="结转日期")
|
||||
duration = fields.Float(string="加班时长", compute="_compute_overtime", store=True)
|
||||
carry_forward_quantity = fields.Float(string="结转时长")
|
||||
validity = fields.Char(string="有效期")
|
||||
carry_forward_state = fields.Selection([('pending', '待结转'),('completed', '已结转'), ('partial', '部分结转')
|
||||
],string='结转状态',
|
||||
default='pending',
|
||||
)
|
||||
remaining_quantity = fields.Float(string='剩余数', compute="_compute_remaining_quantity", store=True)
|
||||
|
||||
def update_line(self):
|
||||
over_ids = self.env["vacation.over.line"].browse(
|
||||
self._context.get('active_ids', self._context.get('active_id')))
|
||||
for rec in over_ids:
|
||||
rec._compute_remaining_quantity()
|
||||
rec._compute_overtime()
|
||||
rec._compute_employee_id()
|
||||
|
||||
@api.depends('duration', 'carry_forward_quantity')
|
||||
def _compute_remaining_quantity(self):
|
||||
for rec in self:
|
||||
rec.remaining_quantity = rec.duration - rec.carry_forward_quantity
|
||||
|
||||
@api.depends('vacation_id')
|
||||
def _compute_employee_id(self):
|
||||
for rec in self:
|
||||
if rec.vacation_id:
|
||||
rec.employee_id = rec.vacation_id.employee_id.id
|
||||
elif not rec.employee_id:
|
||||
rec.employee_id = False
|
||||
|
||||
@api.depends('workflow_record_id')
|
||||
def _compute_overtime(self):
|
||||
for rec in self:
|
||||
if rec.workflow_record_id and rec.update_type == 'add':
|
||||
res_model = rec.workflow_record_id.res_model
|
||||
res_id = rec.workflow_record_id.res_id
|
||||
overtime_id = rec.env[res_model].search([('id', '=', res_id)])
|
||||
rec.overtime_name = overtime_id.name
|
||||
rec.start_time = overtime_id.start_time
|
||||
rec.end_time = overtime_id.end_time
|
||||
rec.duration = overtime_id.duration
|
||||
else:
|
||||
rec.overtime_name = ''
|
||||
rec.start_time = ''
|
||||
rec.end_time = ''
|
||||
rec.duration = 0
|
||||
|
||||
def action_void(self):
|
||||
self.is_void = True
|
||||
|
||||
@@ -969,6 +1020,8 @@ class VacationOverline(models.Model):
|
||||
|
||||
if vals.get('update_type') == 'reduce' and vals.get('vacation_id'):
|
||||
vacation_main = self.env['yuthon.vacation.reports'].browse(vals['vacation_id'])
|
||||
current_vacation_date = vacation_main.vacation_date
|
||||
next_month_first_day = current_vacation_date + relativedelta(months=+1, day=1)
|
||||
deduct_workday = vals.get('workday', 0.0)
|
||||
deduct_public = vals.get('public_holidays', 0.0)
|
||||
deduct_workday_convert = deduct_workday / 8
|
||||
@@ -983,8 +1036,6 @@ class VacationOverline(models.Model):
|
||||
is_cross_year = False
|
||||
# 计算下月1号并判断是否跨年
|
||||
if vacation_main.vacation_date:
|
||||
current_vacation_date = vacation_main.vacation_date
|
||||
next_month_first_day = current_vacation_date + relativedelta(months=+1, day=1)
|
||||
is_cross_year = current_vacation_date.year != next_month_first_day.year
|
||||
|
||||
# 跨年场景
|
||||
@@ -1006,31 +1057,52 @@ class VacationOverline(models.Model):
|
||||
current_text = vals.get('text', '').strip()
|
||||
if current_text != '上月额度继承':
|
||||
vacation_main = self.env['yuthon.vacation.reports'].browse(vals['vacation_id'])
|
||||
current_vacation_date = vacation_main.vacation_date
|
||||
next_month_first_day = current_vacation_date + relativedelta(months=+1, day=1)
|
||||
add_workday = vals.get('workday', 0.0)
|
||||
add_public = vals.get('public_holidays', 0.0)
|
||||
next_month_vacation = self.env['yuthon.vacation.reports'].search([
|
||||
('employee_id', '=', vacation_main.employee_id.id),
|
||||
('vacation_date', '=', next_month_first_day),
|
||||
('vacation_state', 'in', ['not_sent', 'pending']),
|
||||
], limit=1)
|
||||
if vacation_main:
|
||||
vacation_add_vals = {
|
||||
'year_workday': vacation_main.year_workday + add_workday / 8,
|
||||
'year_holiday': vacation_main.year_holiday + add_public / 8,
|
||||
}
|
||||
vacation_main.write(vacation_add_vals)
|
||||
next_month_vacation = self.env['yuthon.vacation.reports'].search([
|
||||
('employee_id', '=', vacation_main.employee_id.id),
|
||||
('vacation_date', '=', next_month_first_day),
|
||||
('vacation_state', 'in', ['not_sent', 'pending']),
|
||||
], limit=1)
|
||||
|
||||
if next_month_vacation:
|
||||
total_add_days = add_workday + add_public
|
||||
inherit_vacation = self.env['vacation.over.line'].search([
|
||||
('vacation_id', '=', next_month_vacation.id),
|
||||
('text', '=', '上月额度继承'),
|
||||
], limit=1)
|
||||
if inherit_vacation:
|
||||
inherit_vacation.write({
|
||||
'year_workday': next_month_vacation.year_workday + add_workday / 8,
|
||||
'year_holiday': next_month_vacation.year_holiday + add_public / 8,
|
||||
'workday': inherit_vacation.workday + total_add_days
|
||||
})
|
||||
|
||||
if vacation_main.vacation_date:
|
||||
current_vacation_date = vacation_main.vacation_date
|
||||
next_month_first_day = current_vacation_date + relativedelta(months=+1, day=1)
|
||||
# 必须是跨年才写入上年工作日
|
||||
is_cross_year = current_vacation_date.year != next_month_first_day.year
|
||||
next_month_vacation = self.env['yuthon.vacation.reports'].search([
|
||||
('employee_id', '=', vacation_main.employee_id.id),
|
||||
('vacation_date', '=', next_month_first_day),
|
||||
('vacation_state', 'in', ['not_sent', 'pending']),
|
||||
], limit=1)
|
||||
if is_cross_year:
|
||||
next_month_deduct_vals = {
|
||||
'last_workday': next_month_vacation.last_workday + add_workday / 8,
|
||||
'last_holiday': next_month_vacation.last_holiday + add_public / 8,
|
||||
}
|
||||
next_month_vacation.write(next_month_deduct_vals)
|
||||
next_month_vacation.previous_year = next_month_vacation.last_workday/8 + next_month_vacation.last_holiday / 8,
|
||||
|
||||
return super(VacationOverline, self).create(vals)
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
<field name="model">overtime.approval</field>
|
||||
<field name="arch" type="xml">
|
||||
<form create="0">
|
||||
|
||||
<!-- <header>-->
|
||||
<!-- <button name="put_hr_employee" type="object" string="Approve" class="oe_highlight"/>-->
|
||||
<!-- </header>-->
|
||||
@@ -127,29 +126,4 @@
|
||||
<field name="domain">[('users_id', '=', uid)]</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<record id="view_overtime_approval_report_tree" model="ir.ui.view">
|
||||
<field name="name">overtime.approval.tree</field>
|
||||
<field name="model">overtime.approval</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="加班情况" editable="bottom">
|
||||
<field name="name"/>
|
||||
<field name="department_id"/>
|
||||
<field name="start_time"/>
|
||||
<field name="end_time"/>
|
||||
<field name="carry_forward_date"/>
|
||||
<field name="carry_forward_duration"/>
|
||||
<field name="carry_forward_result"/>
|
||||
<field name="carry_forward_state"/>
|
||||
<field name="remaining_quantity"/>
|
||||
<field name="validity"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_overtime_approval_report" model="ir.actions.act_window">
|
||||
<field name="name">加班情况</field>
|
||||
<field name="res_model">overtime.approval</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="view_overtime_approval_report_tree"/>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -1,29 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="view_yuthon_holiday_statement_tree" model="ir.ui.view">
|
||||
<field name="name">yuthon.holiday.statement.tree</field>
|
||||
<field name="model">yuthon.holiday.statement</field>
|
||||
<record id="view_hr_leave_statement_tree" model="ir.ui.view">
|
||||
<field name="name">hr.leave.statement.tree</field>
|
||||
<field name="model">hr.leave</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="请假情况" editable="bottom">
|
||||
<tree string="请假情况" editable="bottom" limit="15">
|
||||
<field name="caption"/>
|
||||
<field name="employee_id"/>
|
||||
<field name="leave_approval_type"/>
|
||||
<field name="gender"/>
|
||||
<field name="leave_title"/>
|
||||
<field name="leave_summary"/>
|
||||
<field name="leave_start_date"/>
|
||||
<field name="leave_end_date"/>
|
||||
<field name="leave_duration"/>
|
||||
<field name="leave_start_time"/>
|
||||
<field name="leave_end_time"/>
|
||||
<field name="employee_company_id"/>
|
||||
<field name="holiday_status_id"/>
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
<field name="number_of_days" string="请假时长(天)"/>
|
||||
<field name="leave_stats"/>
|
||||
<field name="application_reason"/>
|
||||
<field name="approval_state"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_yuthon_holiday_statement_action" model="ir.actions.act_window">
|
||||
<field name="name">请假情况</field>
|
||||
<field name="res_model">yuthon.holiday.statement</field>
|
||||
<field name="res_model">hr.leave</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="view_hr_leave_statement_tree"/>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="view_yuthon_overtime_report_tree" model="ir.ui.view">
|
||||
<field name="name">yuthon.overtime.report.tree</field>
|
||||
<field name="model">yuthon.overtime.report</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="加班情况" editable="bottom">
|
||||
<field name="employee_id"/>
|
||||
<field name="department_id"/>
|
||||
<field name="overtime_date"/>
|
||||
<field name="carry_forward_date"/>
|
||||
<field name="carry_forward_duration"/>
|
||||
<field name="carry_forward_result"/>
|
||||
<field name="carry_forward_state"/>
|
||||
<field name="remaining_quantity"/>
|
||||
<field name="validity"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_yuthon_overtime_report" model="ir.actions.act_window">
|
||||
<field name="name">加班情况</field>
|
||||
<field name="res_model">yuthon.overtime.report</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -5,8 +5,8 @@
|
||||
<field name="model">yuthon.vacation.reports</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="误餐情况">
|
||||
<field name="employee_id"/>
|
||||
<field name="meal_fee"/>
|
||||
<field name="employee_id"/>
|
||||
<field name="meal_fee"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -286,7 +286,23 @@
|
||||
<!-- </tree>-->
|
||||
<!-- </field>-->
|
||||
<!-- </page>-->
|
||||
<page string="汇总" invisible="1">
|
||||
<page string="管理员修改字段" groups="base.group_system">
|
||||
<group col="2">
|
||||
<group>
|
||||
<field name="previous_year"/>
|
||||
<field name="year_distribution"/>
|
||||
<field name="used_this_year"/>
|
||||
<field name="last_holiday"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="last_workday"/>
|
||||
<field name="year_holiday"/>
|
||||
<field name="year_workday"/>
|
||||
<field name="used_this_year1"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<page string="汇总" >
|
||||
<group>
|
||||
<field name="is_late_card"/>
|
||||
<field name="is_early_card"/>
|
||||
@@ -491,10 +507,57 @@
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_yuthon_vacation_overtime_tree" model="ir.ui.view">
|
||||
<field name="name">vacation.over.line.overtime.tree</field>
|
||||
<field name="model">vacation.over.line</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="加班情况" editable="bottom">
|
||||
<field name="overtime_name"/>
|
||||
<field name="employee_id"/>
|
||||
<field name="department_id"/>
|
||||
<field name="start_time"/>
|
||||
<field name="end_time"/>
|
||||
<field name="duration"/>
|
||||
<field name="carry_forward_quantity"/>
|
||||
<field name="carry_forward_date"/>
|
||||
<field name="carry_forward_state"/>
|
||||
<field name="remaining_quantity"/>
|
||||
<field name="validity"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_yuthon_vacation_overtime_search" model="ir.ui.view">
|
||||
<field name="name">vacation.over.line.overtime.search</field>
|
||||
<field name="model">vacation.over.line</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="加班情况">
|
||||
<field name="overtime_name"/>
|
||||
<field name="employee_id"/>
|
||||
<field name="department_id"/>
|
||||
<field name="start_time"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_overtime_approval_report" model="ir.actions.act_window">
|
||||
<field name="name">加班情况</field>
|
||||
<field name="res_model">vacation.over.line</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="domain">[('workflow_record_id','!=', False), ('update_type', '=', 'add')]</field>
|
||||
<field name="view_id" ref="view_yuthon_vacation_overtime_tree"/>
|
||||
<field name="search_view_id" ref="view_yuthon_vacation_overtime_search"/>
|
||||
</record>
|
||||
<record id="update_vacation_over_line" model="ir.actions.server">
|
||||
<field name="name">触发计算逻辑</field>
|
||||
<field name="model_id" ref="yuthon_hr_attendance.model_vacation_over_line"/>
|
||||
<field name="binding_model_id" ref="yuthon_hr_attendance.model_vacation_over_line"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">action = model.update_line()</field>
|
||||
</record>
|
||||
<record id="view_yuthon_vacation_meal_action" model="ir.actions.act_window">
|
||||
<field name="name">误餐情况</field>
|
||||
<field name="res_model">yuthon.vacation.reports</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="domain">[('meal_fee', '!=', 0)]</field>
|
||||
<field name="context">{'search_default_group_by_employee_id': 1, 'search_default_group_by_vacation_month': True}</field>
|
||||
<field name="view_ids" eval="[(5, 0, 0),
|
||||
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_hr_attendance.view_yuthon_vacation_meal_tree')}),]"/>
|
||||
|
||||
@@ -167,7 +167,8 @@ class YuthonWillTask(models.Model):
|
||||
if minute1 == now.minute and hour1 == now.hour:
|
||||
task.write({'task_state': 'done'})
|
||||
will_id = task.yuthon_will_task_id
|
||||
for employee_id in will_id.employee_ids:
|
||||
will_id.task_state = 'done'
|
||||
for employee_id in task.employee_ids:
|
||||
url = f'https://phone.thtzjt.com/phone/Schedule/{task.yuthon_will_task_id.id}/{employee_id.id}'
|
||||
data_date = '时间:' + (task.reminder_time + timedelta(hours=8)).strftime("%Y-%m-%d %H:%M:%S") + '\n'
|
||||
data_name = "事项名称: " + task.yuthon_will_task_id.name + '\n'
|
||||
@@ -290,4 +291,5 @@ class YuthonWillTask(models.Model):
|
||||
'view_mode': 'tree',
|
||||
'res_model': 'yuthon.dates.task',
|
||||
'domain': [('yuthon_will_task_id', '=', self.id)],
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -170,11 +170,11 @@
|
||||
parent="hr_attendance_root_board_menu"
|
||||
action="yuthon_hr_attendance.action_overtime_approval_report"
|
||||
sequence="15"/>
|
||||
<!-- <menuitem id="menu_yuthon_holiday_statement_board"-->
|
||||
<!-- name="请假情况"-->
|
||||
<!-- parent="hr_attendance_root_board_menu"-->
|
||||
<!-- action="yuthon_hr_attendance.view_yuthon_holiday_statement_action"-->
|
||||
<!-- sequence="16"/>-->
|
||||
<menuitem id="menu_yuthon_holiday_statement_board"
|
||||
name="请假情况"
|
||||
parent="hr_attendance_root_board_menu"
|
||||
action="yuthon_hr_attendance.view_yuthon_holiday_statement_action"
|
||||
sequence="16"/>
|
||||
<menuitem id="menu_yuthon_meal_case_board"
|
||||
name="误餐情况"
|
||||
parent="hr_attendance_root_board_menu"
|
||||
|
||||
Reference in New Issue
Block a user