添加功能
This commit is contained in:
@@ -50,7 +50,14 @@ class YuthonCatering(models.Model):
|
|||||||
"""
|
"""
|
||||||
判断是否是工作日 调休日 双休
|
判断是否是工作日 调休日 双休
|
||||||
"""
|
"""
|
||||||
calendar_leaves = self.env['resource.calendar.leaves'].search([("calendar_id", "=", "行政考勤工作日")])
|
current_year = (fields.Date.today() + timedelta(hours=8)).year
|
||||||
|
query_start = datetime(current_year, 1, 1, 0, 0, 0) - timedelta(hours=8)
|
||||||
|
query_end = datetime(current_year, 12, 31, 23, 59, 59) - timedelta(hours=8)
|
||||||
|
calendar_leaves = self.env['resource.calendar.leaves'].sudo().search([
|
||||||
|
("calendar_id.name", "=", "行政考勤工作日"),
|
||||||
|
("date_from", ">=", query_start),
|
||||||
|
("date_from", "<=", query_end)
|
||||||
|
])
|
||||||
holidays_list = []
|
holidays_list = []
|
||||||
shift_days_list = []
|
shift_days_list = []
|
||||||
# 提取节假日和调休日
|
# 提取节假日和调休日
|
||||||
|
|||||||
@@ -593,7 +593,14 @@ class HolidaysRequestBatch(models.Model):
|
|||||||
days = 0
|
days = 0
|
||||||
return days
|
return days
|
||||||
if holiday_status_id.type_of_work == "0":
|
if holiday_status_id.type_of_work == "0":
|
||||||
calendar_leaves = self.env['resource.calendar.leaves'].search([("calendar_id", "=", "行政考勤工作日")])
|
current_year = (fields.Date.today() + timedelta(hours=8)).year
|
||||||
|
query_start = datetime(current_year, 1, 1, 0, 0, 0) - timedelta(hours=8)
|
||||||
|
query_end = datetime(current_year, 12, 31, 23, 59, 59) - timedelta(hours=8)
|
||||||
|
calendar_leaves = self.env['resource.calendar.leaves'].sudo().search([
|
||||||
|
("calendar_id.name", "=", "行政考勤工作日"),
|
||||||
|
("date_from", ">=", query_start),
|
||||||
|
("date_from", "<=", query_end)
|
||||||
|
])
|
||||||
holidays_list = []
|
holidays_list = []
|
||||||
shift_days_list = []
|
shift_days_list = []
|
||||||
# 提取节假日和调休日
|
# 提取节假日和调休日
|
||||||
|
|||||||
@@ -307,8 +307,14 @@ class AppletAttendance(Controller):
|
|||||||
如果是工作日返回True
|
如果是工作日返回True
|
||||||
如果是休息日返回False
|
如果是休息日返回False
|
||||||
"""
|
"""
|
||||||
calendar_leaves = request.env['resource.calendar.leaves'].sudo().search(
|
current_year = (fields.Date.today() + timedelta(hours=8)).year
|
||||||
[("calendar_id", "=", "行政考勤工作日")])
|
query_start = datetime(current_year, 1, 1, 0, 0, 0) - timedelta(hours=8)
|
||||||
|
query_end = datetime(current_year, 12, 31, 23, 59, 59) - timedelta(hours=8)
|
||||||
|
calendar_leaves = self.env['resource.calendar.leaves'].sudo().search([
|
||||||
|
("calendar_id.name", "=", "行政考勤工作日"),
|
||||||
|
("date_from", ">=", query_start),
|
||||||
|
("date_from", "<=", query_end)
|
||||||
|
])
|
||||||
holidays_set = set()
|
holidays_set = set()
|
||||||
shift_days_set = set()
|
shift_days_set = set()
|
||||||
for leave in calendar_leaves:
|
for leave in calendar_leaves:
|
||||||
@@ -757,7 +763,12 @@ class AppletAttendance(Controller):
|
|||||||
# 从start_date中提取年份
|
# 从start_date中提取年份
|
||||||
target_year = start_date.year
|
target_year = start_date.year
|
||||||
target_month = start_date.month
|
target_month = start_date.month
|
||||||
domain = [("calendar_id", "=", "行政考勤工作日")]
|
current_year = (fields.Date.today() + timedelta(hours=8)).year
|
||||||
|
query_start = datetime(current_year, 1, 1, 0, 0, 0) - timedelta(hours=8)
|
||||||
|
query_end = datetime(current_year, 12, 31, 23, 59, 59) - timedelta(hours=8)
|
||||||
|
domain = [("calendar_id", "=", "行政考勤工作日"),
|
||||||
|
("date_from", ">=", query_start),
|
||||||
|
("date_from", "<=", query_end)]
|
||||||
if start_date and end_date:
|
if start_date and end_date:
|
||||||
# 将date对象转换为datetime对象
|
# 将date对象转换为datetime对象
|
||||||
start_datetime = datetime.combine(start_date, datetime.min.time())
|
start_datetime = datetime.combine(start_date, datetime.min.time())
|
||||||
|
|||||||
@@ -338,7 +338,14 @@ class HrAttendance(models.Model):
|
|||||||
"""
|
"""
|
||||||
判断是否是工作日 调休日 双休
|
判断是否是工作日 调休日 双休
|
||||||
"""
|
"""
|
||||||
calendar_leaves = self.env['resource.calendar.leaves'].search([("calendar_id", "=", "行政考勤工作日")])
|
current_year = (fields.Date.today() + timedelta(hours=8)).year
|
||||||
|
query_start = datetime(current_year, 1, 1, 0, 0, 0) - timedelta(hours=8)
|
||||||
|
query_end = datetime(current_year, 12, 31, 23, 59, 59) - timedelta(hours=8)
|
||||||
|
calendar_leaves = self.env['resource.calendar.leaves'].sudo().search([
|
||||||
|
("calendar_id.name", "=", "行政考勤工作日"),
|
||||||
|
("date_from", ">=", query_start),
|
||||||
|
("date_from", "<=", query_end)
|
||||||
|
])
|
||||||
holidays_list = []
|
holidays_list = []
|
||||||
shift_days_list = []
|
shift_days_list = []
|
||||||
# 提取节假日和调休日
|
# 提取节假日和调休日
|
||||||
@@ -1079,8 +1086,13 @@ class HrAttendance(models.Model):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
if record.current_data:
|
if record.current_data:
|
||||||
|
current_year = (fields.Date.today() + timedelta(hours=8)).year
|
||||||
|
query_start = datetime(current_year, 1, 1, 0, 0, 0) - timedelta(hours=8)
|
||||||
|
query_end = datetime(current_year, 12, 31, 23, 59, 59) - timedelta(hours=8)
|
||||||
leave_records = self.env['resource.calendar.leaves'].search([
|
leave_records = self.env['resource.calendar.leaves'].search([
|
||||||
("calendar_id.name", "=", "行政考勤工作日")
|
("calendar_id.name", "=", "行政考勤工作日"),
|
||||||
|
("date_from", ">=", query_start),
|
||||||
|
("date_from", "<=", query_end)
|
||||||
])
|
])
|
||||||
# 检查是否为节假日
|
# 检查是否为节假日
|
||||||
for leave in leave_records:
|
for leave in leave_records:
|
||||||
@@ -1168,8 +1180,13 @@ class HrAttendance(models.Model):
|
|||||||
is_weekend = False
|
is_weekend = False
|
||||||
if record.current_data:
|
if record.current_data:
|
||||||
# 查询休假记录
|
# 查询休假记录
|
||||||
|
current_year = (fields.Date.today() + timedelta(hours=8)).year
|
||||||
|
query_start = datetime(current_year, 1, 1, 0, 0, 0) - timedelta(hours=8)
|
||||||
|
query_end = datetime(current_year, 12, 31, 23, 59, 59) - timedelta(hours=8)
|
||||||
leave_records = self.env['resource.calendar.leaves'].search(
|
leave_records = self.env['resource.calendar.leaves'].search(
|
||||||
[("calendar_id", "=", "行政考勤工作日")])
|
[("calendar_id.name", "=", "行政考勤工作日"),
|
||||||
|
("date_from", ">=", query_start),
|
||||||
|
("date_from", "<=", query_end)])
|
||||||
# 检查是否存在匹配的休假日期
|
# 检查是否存在匹配的休假日期
|
||||||
for leave in leave_records:
|
for leave in leave_records:
|
||||||
if leave.date_from and leave.date_to:
|
if leave.date_from and leave.date_to:
|
||||||
|
|||||||
@@ -461,7 +461,14 @@ class HrAttendanceDetail(models.Model):
|
|||||||
"""
|
"""
|
||||||
判断是否是工作日 调休日 双休
|
判断是否是工作日 调休日 双休
|
||||||
"""
|
"""
|
||||||
calendar_leaves = self.env['resource.calendar.leaves'].search([("calendar_id", "=", "行政考勤工作日")])
|
current_year = (fields.Date.today() + timedelta(hours=8)).year
|
||||||
|
query_start = datetime(current_year, 1, 1, 0, 0, 0) - timedelta(hours=8)
|
||||||
|
query_end = datetime(current_year, 12, 31, 23, 59, 59) - timedelta(hours=8)
|
||||||
|
calendar_leaves = self.env['resource.calendar.leaves'].sudo().search([
|
||||||
|
("calendar_id.name", "=", "行政考勤工作日"),
|
||||||
|
("date_from", ">=", query_start),
|
||||||
|
("date_from", "<=", query_end)
|
||||||
|
])
|
||||||
holidays_list = []
|
holidays_list = []
|
||||||
shift_days_list = []
|
shift_days_list = []
|
||||||
# 提取节假日和调休日
|
# 提取节假日和调休日
|
||||||
|
|||||||
@@ -430,7 +430,14 @@ class HrAttendanceMonthDetail(models.Model):
|
|||||||
days = 0
|
days = 0
|
||||||
return days
|
return days
|
||||||
if holiday_status_id.type_of_work == 0:
|
if holiday_status_id.type_of_work == 0:
|
||||||
calendar_leaves = self.env['resource.calendar.leaves'].search([("calendar_id", "=", "行政考勤工作日")])
|
current_year = (fields.Date.today() + timedelta(hours=8)).year
|
||||||
|
query_start = datetime.datetime(current_year, 1, 1, 0, 0, 0) - timedelta(hours=8)
|
||||||
|
query_end = datetime.datetime(current_year, 12, 31, 23, 59, 59) - timedelta(hours=8)
|
||||||
|
calendar_leaves = self.env['resource.calendar.leaves'].sudo().search([
|
||||||
|
("calendar_id.name", "=", "行政考勤工作日"),
|
||||||
|
("date_from", ">=", query_start),
|
||||||
|
("date_from", "<=", query_end)
|
||||||
|
])
|
||||||
holidays_list = []
|
holidays_list = []
|
||||||
shift_days_list = []
|
shift_days_list = []
|
||||||
# 提取节假日和调休日
|
# 提取节假日和调休日
|
||||||
|
|||||||
@@ -198,7 +198,14 @@ class MessageReminderTasks(models.Model):
|
|||||||
"""
|
"""
|
||||||
判断是否是工作日 调休日 双休
|
判断是否是工作日 调休日 双休
|
||||||
"""
|
"""
|
||||||
calendar_leaves = self.env['resource.calendar.leaves'].search([("calendar_id", "=", "行政考勤工作日")])
|
current_year = (fields.Date.today() + timedelta(hours=8)).year
|
||||||
|
query_start = datetime(current_year, 1, 1, 0, 0, 0) - timedelta(hours=8)
|
||||||
|
query_end = datetime(current_year, 12, 31, 23, 59, 59) - timedelta(hours=8)
|
||||||
|
calendar_leaves = self.env['resource.calendar.leaves'].sudo().search([
|
||||||
|
("calendar_id.name", "=", "行政考勤工作日"),
|
||||||
|
("date_from", ">=", query_start),
|
||||||
|
("date_from", "<=", query_end)
|
||||||
|
])
|
||||||
holidays_list = []
|
holidays_list = []
|
||||||
shift_days_list = []
|
shift_days_list = []
|
||||||
# 提取节假日和调休日
|
# 提取节假日和调休日
|
||||||
|
|||||||
@@ -346,7 +346,12 @@ class OvertimeApprovals(models.Model):
|
|||||||
raise UserError("开始时间不能晚于结束时间")
|
raise UserError("开始时间不能晚于结束时间")
|
||||||
start_date = fields.Datetime.from_string(record.start_time)
|
start_date = fields.Datetime.from_string(record.start_time)
|
||||||
end_date = fields.Datetime.from_string(record.end_time)
|
end_date = fields.Datetime.from_string(record.end_time)
|
||||||
public_holidays = self.env['resource.calendar.leaves'].search([("calendar_id", "=", "行政考勤工作日")])
|
current_year = (fields.Date.today() + timedelta(hours=8)).year
|
||||||
|
query_start = datetime(current_year, 1, 1, 0, 0, 0) - timedelta(hours=8)
|
||||||
|
query_end = datetime(current_year, 12, 31, 23, 59, 59) - timedelta(hours=8)
|
||||||
|
public_holidays = self.env['resource.calendar.leaves'].search([("calendar_id.name", "=", "行政考勤工作日"),
|
||||||
|
("date_from", ">=", query_start),
|
||||||
|
("date_from", "<=", query_end)])
|
||||||
for holiday in public_holidays:
|
for holiday in public_holidays:
|
||||||
holiday_start = fields.Datetime.from_string(holiday.date_from)
|
holiday_start = fields.Datetime.from_string(holiday.date_from)
|
||||||
holiday_end = fields.Datetime.from_string(holiday.date_to)
|
holiday_end = fields.Datetime.from_string(holiday.date_to)
|
||||||
|
|||||||
@@ -343,9 +343,14 @@ class YuthonVacationReports(models.Model):
|
|||||||
entry_date = employee_id.entry_date
|
entry_date = employee_id.entry_date
|
||||||
# 调整日期范围:如果开始日期早于入职日期,则从入职日期开始计算
|
# 调整日期范围:如果开始日期早于入职日期,则从入职日期开始计算
|
||||||
actual_start_date = max(start_date, entry_date) if entry_date else start_date
|
actual_start_date = max(start_date, entry_date) if entry_date else start_date
|
||||||
calendar_leaves = self.env['resource.calendar.leaves'].search(
|
current_year = (fields.Date.today() + timedelta(hours=8)).year
|
||||||
[("calendar_id.name", "=", "行政考勤工作日")])
|
query_start = datetime(current_year, 1, 1, 0, 0, 0) - timedelta(hours=8)
|
||||||
|
query_end = datetime(current_year, 12, 31, 23, 59, 59) - timedelta(hours=8)
|
||||||
|
calendar_leaves = self.env['resource.calendar.leaves'].sudo().search([
|
||||||
|
("calendar_id.name", "=", "行政考勤工作日"),
|
||||||
|
("date_from", ">=", query_start),
|
||||||
|
("date_from", "<=", query_end)
|
||||||
|
])
|
||||||
holidays_list = [] # 节假日列表
|
holidays_list = [] # 节假日列表
|
||||||
statutory_list = [] # 法定节假日列表
|
statutory_list = [] # 法定节假日列表
|
||||||
shift_days_list = [] # 调休日列表
|
shift_days_list = [] # 调休日列表
|
||||||
@@ -1014,7 +1019,14 @@ class VacationMedicalLine(models.Model):
|
|||||||
return record
|
return record
|
||||||
|
|
||||||
def create_leave_record(self, start_date, end_date):
|
def create_leave_record(self, start_date, end_date):
|
||||||
calendar_leaves = self.env['resource.calendar.leaves'].search([("calendar_id", "=", "行政考勤工作日")])
|
current_year = (fields.Date.today() + timedelta(hours=8)).year
|
||||||
|
query_start = datetime(current_year, 1, 1, 0, 0, 0) - timedelta(hours=8)
|
||||||
|
query_end = datetime(current_year, 12, 31, 23, 59, 59) - timedelta(hours=8)
|
||||||
|
calendar_leaves = self.env['resource.calendar.leaves'].sudo().search([
|
||||||
|
("calendar_id.name", "=", "行政考勤工作日"),
|
||||||
|
("date_from", ">=", query_start),
|
||||||
|
("date_from", "<=", query_end)
|
||||||
|
])
|
||||||
holidays_list = []
|
holidays_list = []
|
||||||
shift_days_list = []
|
shift_days_list = []
|
||||||
# 提取节假日和调休日
|
# 提取节假日和调休日
|
||||||
@@ -1066,6 +1078,9 @@ class VacationOtherLine(models.Model):
|
|||||||
text = fields.Text(string='备注')
|
text = fields.Text(string='备注')
|
||||||
is_confirm = fields.Boolean(string="是否确认")
|
is_confirm = fields.Boolean(string="是否确认")
|
||||||
|
|
||||||
|
def action_void(self):
|
||||||
|
self.is_void = True
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def create(self, vals):
|
def create(self, vals):
|
||||||
if vals.get('vacation_id'):
|
if vals.get('vacation_id'):
|
||||||
|
|||||||
@@ -155,7 +155,7 @@
|
|||||||
<field name="is_confirm" column_invisible="1"/>
|
<field name="is_confirm" column_invisible="1"/>
|
||||||
<button name="unlink" string="删除" type="object" class="btn-primary" groups="yuthon_holiday.group_yuthon_holiday_admin"/>
|
<button name="unlink" string="删除" type="object" class="btn-primary" groups="yuthon_holiday.group_yuthon_holiday_admin"/>
|
||||||
<button name="unlink" string="撤销" invisible="is_confirm == True" type="object" class="btn-primary"/>
|
<button name="unlink" string="撤销" invisible="is_confirm == True" type="object" class="btn-primary"/>
|
||||||
<button name="action_void" string="作废" class="btn-primary" invisible="is_confirm != True"/>
|
<button name="action_void" string="作废" class="btn-primary" invisible="is_confirm != True" type="object"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</page>
|
</page>
|
||||||
@@ -180,7 +180,7 @@
|
|||||||
<field name="text"/>
|
<field name="text"/>
|
||||||
<button name="unlink" string="删除" type="object" class="btn-primary" groups="yuthon_holiday.group_yuthon_holiday_admin"/>
|
<button name="unlink" string="删除" type="object" class="btn-primary" groups="yuthon_holiday.group_yuthon_holiday_admin"/>
|
||||||
<button name="unlink" string="撤销" invisible="is_confirm == True" type="object" class="btn-primary"/>
|
<button name="unlink" string="撤销" invisible="is_confirm == True" type="object" class="btn-primary"/>
|
||||||
<button name="action_void" string="作废" class="btn-primary" invisible="is_confirm != True"/>
|
<button name="action_void" string="作废" class="btn-primary" invisible="is_confirm != True" type="object"/>
|
||||||
<field name="is_confirm" column_invisible="1"/>
|
<field name="is_confirm" column_invisible="1"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
@@ -201,7 +201,7 @@
|
|||||||
<field name="text"/>
|
<field name="text"/>
|
||||||
<button name="unlink" string="删除" type="object" class="btn-primary" groups="yuthon_holiday.group_yuthon_holiday_admin"/>
|
<button name="unlink" string="删除" type="object" class="btn-primary" groups="yuthon_holiday.group_yuthon_holiday_admin"/>
|
||||||
<button name="unlink" string="撤销" invisible="is_confirm == True" type="object" class="btn-primary"/>
|
<button name="unlink" string="撤销" invisible="is_confirm == True" type="object" class="btn-primary"/>
|
||||||
<button name="action_void" string="作废" class="btn-primary" invisible="is_confirm != True"/>
|
<button name="action_void" string="作废" class="btn-primary" invisible="is_confirm != True" type="object"/>
|
||||||
<field name="is_confirm" column_invisible="1"/>
|
<field name="is_confirm" column_invisible="1"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
@@ -221,7 +221,7 @@
|
|||||||
<field name="text"/>
|
<field name="text"/>
|
||||||
<button name="unlink" string="删除" type="object" class="btn-primary" groups="yuthon_holiday.group_yuthon_holiday_admin"/>
|
<button name="unlink" string="删除" type="object" class="btn-primary" groups="yuthon_holiday.group_yuthon_holiday_admin"/>
|
||||||
<button name="unlink" string="撤销" invisible="is_confirm == True" type="object" class="btn-primary"/>
|
<button name="unlink" string="撤销" invisible="is_confirm == True" type="object" class="btn-primary"/>
|
||||||
<button name="action_void" string="作废" class="btn-primary" invisible="is_confirm != True"/>
|
<button name="action_void" string="作废" class="btn-primary" invisible="is_confirm != True" type="object"/>
|
||||||
<field name="is_confirm" column_invisible="1"/>
|
<field name="is_confirm" column_invisible="1"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
@@ -241,7 +241,7 @@
|
|||||||
<field name="text"/>
|
<field name="text"/>
|
||||||
<button name="unlink" string="删除" type="object" class="btn-primary" groups="yuthon_holiday.group_yuthon_holiday_admin"/>
|
<button name="unlink" string="删除" type="object" class="btn-primary" groups="yuthon_holiday.group_yuthon_holiday_admin"/>
|
||||||
<button name="unlink" string="撤销" invisible="is_confirm == True" type="object" class="btn-primary"/>
|
<button name="unlink" string="撤销" invisible="is_confirm == True" type="object" class="btn-primary"/>
|
||||||
<button name="action_void" string="作废" class="btn-primary" invisible="is_confirm != True"/>
|
<button name="action_void" string="作废" class="btn-primary" invisible="is_confirm != True" type="object"/>
|
||||||
<field name="is_confirm" column_invisible="1"/>
|
<field name="is_confirm" column_invisible="1"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
|
|||||||
@@ -163,7 +163,14 @@ class HrAttendanceMonthWizard(models.TransientModel):
|
|||||||
# 创建用户记录传入日期来获取天数
|
# 创建用户记录传入日期来获取天数
|
||||||
def _create_leave_record(self, holiday_status_id, start_date, end_date):
|
def _create_leave_record(self, holiday_status_id, start_date, end_date):
|
||||||
if holiday_status_id.type_of_work == 0:
|
if holiday_status_id.type_of_work == 0:
|
||||||
calendar_leaves = self.env['resource.calendar.leaves'].search([("calendar_id", "=", "行政考勤工作日")])
|
current_year = (fields.Date.today() + timedelta(hours=8)).year
|
||||||
|
query_start = datetime.datetime(current_year, 1, 1, 0, 0, 0) - timedelta(hours=8)
|
||||||
|
query_end = datetime.datetime(current_year, 12, 31, 23, 59, 59) - timedelta(hours=8)
|
||||||
|
calendar_leaves = self.env['resource.calendar.leaves'].sudo().search([
|
||||||
|
("calendar_id.name", "=", "行政考勤工作日"),
|
||||||
|
("date_from", ">=", query_start),
|
||||||
|
("date_from", "<=", query_end)
|
||||||
|
])
|
||||||
holidays_list = []
|
holidays_list = []
|
||||||
shift_days_list = []
|
shift_days_list = []
|
||||||
# 提取节假日和调休日
|
# 提取节假日和调休日
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<field name="department_id"/>
|
<field name="department_id"/>
|
||||||
<field name="information_categories_ids" widget="many2many_tags"/>
|
<field name="information_categories_ids" widget="many2many_tags" options="{'no_create': True}"/>
|
||||||
<field name="contract_type"/>
|
<field name="contract_type"/>
|
||||||
<field name="purchase_type"/>
|
<field name="purchase_type"/>
|
||||||
</group>
|
</group>
|
||||||
|
|||||||
@@ -371,7 +371,14 @@ class SalaryComputeWizard(models.Model):
|
|||||||
return chinese_months[month - 1]
|
return chinese_months[month - 1]
|
||||||
|
|
||||||
def _process_shift_days(self, start_date, end_date):
|
def _process_shift_days(self, start_date, end_date):
|
||||||
calendar_leaves = self.env['resource.calendar.leaves'].search([("calendar_id", "=", "行政考勤工作日")])
|
current_year = (fields.Date.today() + timedelta(hours=8)).year
|
||||||
|
query_start = datetime(current_year, 1, 1, 0, 0, 0) - timedelta(hours=8)
|
||||||
|
query_end = datetime(current_year, 12, 31, 23, 59, 59) - timedelta(hours=8)
|
||||||
|
calendar_leaves = self.env['resource.calendar.leaves'].sudo().search([
|
||||||
|
("calendar_id.name", "=", "行政考勤工作日"),
|
||||||
|
("date_from", ">=", query_start),
|
||||||
|
("date_from", "<=", query_end)
|
||||||
|
])
|
||||||
holidays_list = []
|
holidays_list = []
|
||||||
shift_days_list = []
|
shift_days_list = []
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
<field name="work_end" invisible="1"/>
|
<field name="work_end" invisible="1"/>
|
||||||
<field name="name" string="事项标题"/>
|
<field name="name" string="事项标题"/>
|
||||||
<field name="users_id"/>
|
<field name="users_id"/>
|
||||||
<field name="information_categories_ids" widget="many2many_tags" string="业务类型"/>
|
<field name="information_categories_ids" widget="many2many_tags" string="业务类型" options="{'no_create': True}"/>
|
||||||
<field name="reason" string="事项说明"/>
|
<field name="reason" string="事项说明"/>
|
||||||
<field name="document_ids" widget="preview_many2many" string="附件清单"/>
|
<field name="document_ids" widget="preview_many2many" string="附件清单"/>
|
||||||
<field name="type_stamp_ids" widget="many2many_tags" options="{'no_create': True, 'no_open': True}" invisible="is_chapter == 'no' or not is_chapter"/>
|
<field name="type_stamp_ids" widget="many2many_tags" options="{'no_create': True, 'no_open': True}" invisible="is_chapter == 'no' or not is_chapter"/>
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
<group>
|
<group>
|
||||||
<field name="work_end" invisible="1"/>
|
<field name="work_end" invisible="1"/>
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="information_categories_ids" widget="many2many_tags"/>
|
<field name="information_categories_ids" widget="many2many_tags" options="{'no_create': True}"/>
|
||||||
<field name="text"/>
|
<field name="text"/>
|
||||||
<field name="documents_ids" widget="preview_many2many"/>
|
<field name="documents_ids" widget="preview_many2many"/>
|
||||||
</group>
|
</group>
|
||||||
|
|||||||
Reference in New Issue
Block a user