添加功能
This commit is contained in:
@@ -144,18 +144,24 @@ class HolidaysRequestBatch(models.Model):
|
||||
self.leave_ids.action_validate()
|
||||
self.hour_leave_ids.action_validate()
|
||||
|
||||
# @api.onchange('leave_line_ids')
|
||||
# def _onchange_name(self):
|
||||
# if self.leave_line_ids:
|
||||
# for leave in self.leave_line_ids:
|
||||
# employee_name = leave.employee_id.name
|
||||
# leave_types = [leave.leave_type_id.name]
|
||||
# if leave.leave_type_id.name:
|
||||
# self.name = f"{employee_name}的{'、'.join(leave_types)}"
|
||||
# else:
|
||||
# self.name = f"{employee_name}的休假"
|
||||
# else:
|
||||
# self.name = '休假'
|
||||
@api.onchange('leave_ids', 'hour_leave_ids')
|
||||
def _onchange_name(self):
|
||||
employee_name = self.users_id.name
|
||||
if self.leave_ids or self.hour_leave_ids:
|
||||
leave_types = []
|
||||
for leave in self.leave_ids:
|
||||
if leave.number_of_days_display:
|
||||
leave_types.append(f"{leave.holiday_status_id.name}({leave.number_of_days_display}天)")
|
||||
else:
|
||||
leave_types.append(f"{leave.holiday_status_id.name}")
|
||||
for leave in self.hour_leave_ids:
|
||||
if leave.number_of_hours_display:
|
||||
leave_types.append(f"{leave.holiday_status_id.name}({leave.number_of_hours_text})")
|
||||
else:
|
||||
leave_types.append(f"{leave.holiday_status_id.name}")
|
||||
self.name = f"{employee_name}的{'、'.join(leave_types)}"
|
||||
else:
|
||||
self.name = f'{employee_name}的休假'
|
||||
|
||||
|
||||
class HrLeaveLine(models.Model):
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
'views/yuthon_shift_approval_views.xml',
|
||||
'views/plan_views.xml',
|
||||
'views/card_remind_form.xml',
|
||||
'views/yuthon_customer_planning_views.xml',
|
||||
'views/all_attendance_menu.xml',
|
||||
|
||||
],
|
||||
|
||||
@@ -21,6 +21,7 @@ from . import yuthon_abnormal_approval
|
||||
from . import yuthon_abnormal_setting
|
||||
from . import yuthon_shift_approval
|
||||
from . import yuthon_special_approval
|
||||
from . import yuthon_customer_planning
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
from odoo import api, fields, models, tools, _
|
||||
from datetime import datetime, timedelta ,time
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class YuthonCustomerPlanning(models.Model):
|
||||
_name = 'yuthon.customer.planning'
|
||||
_description = '客户排班计划'
|
||||
|
||||
name = fields.Char(string='计划名称', required=True)
|
||||
start_index_time = fields.Date(string='生效时间', default=fields.Date.today())
|
||||
end_index_time = fields.Date(string='失效时间')
|
||||
is_enable = fields.Boolean(string="启用", default=True)
|
||||
plan_line_ids = fields.One2many('customer.plan.line', 'customer_plan_id', string='关联计划明细')
|
||||
notice = fields.Text(string='计划说明')
|
||||
select_time = fields.Selection([('1', '一月'), ('2', '二月'), ('3', '三月'), ('4', '四月'),
|
||||
('5', '五月'), ('6', '六月'), ('7', '七月'), ('8', '八月'),
|
||||
('9', '九月'), ('10', '十月'), ('11', '十一月'),
|
||||
('12', '十二月')], string='选择月份')
|
||||
|
||||
def auto_customer_plan(self, next_date=False):
|
||||
selected_month = int(self.select_time)
|
||||
year = datetime.now().year
|
||||
if not next_date:
|
||||
start_date = datetime(year, selected_month, 1)
|
||||
# 计算结束日期(下个月的第一天)
|
||||
next_month = (selected_month % 12) + 1
|
||||
next_year = year + (1 if next_month == 1 else 0) # 如果是12月,年份加1
|
||||
end_date = datetime(next_year, next_month, 1)
|
||||
else:
|
||||
next_month = (selected_month % 12) + 1
|
||||
next_year = year + (1 if next_month == 1 else 0)
|
||||
start_date = datetime(next_year, next_month, 1)
|
||||
next_next_month = (next_month % 12) + 1
|
||||
next_next_year = next_year + (1 if next_next_month == 1 else 0)
|
||||
end_date = datetime(next_next_year, next_next_month, 1)
|
||||
|
||||
role_a = self.env['planning.role'].search([('name', '=', '客服中心')], limit=1)
|
||||
role_template_a = self.env['planning.slot.template'].search([('planning_name', '=', '白班'), ('role_id', '=', role_a.id)])
|
||||
role_template_b = self.env['planning.slot.template'].search([('planning_name', '=', '白班'), ('role_id', '=', role_a.id)])
|
||||
current_date = start_date
|
||||
while current_date <= end_date:
|
||||
day_of_week = current_date.weekday()
|
||||
if day_of_week < 6:
|
||||
if day_of_week < 5:
|
||||
for employee in self.plan_line_ids:
|
||||
self.create_planning_slot(employee, role_a, role_template_a, current_date)
|
||||
elif day_of_week == 5:
|
||||
current_employee = self.plan_line_ids[current_date.day % len(self.plan_line_ids)]
|
||||
self.create_planning_slot(current_employee, role_a, role_template_b, current_date)
|
||||
current_date += timedelta(days=1)
|
||||
|
||||
def customer_next_plan(self):
|
||||
self.auto_customer_plan(next_date=True)
|
||||
|
||||
def create_planning_slot(self, record, role, role_template, current_date):
|
||||
start_hour = int(role_template.start_time)
|
||||
end_hour = int(role_template.end_time)
|
||||
current_datetime = datetime.combine(current_date, time(0, 0, 0))
|
||||
start_time = current_datetime.replace(hour=start_hour) + timedelta(hours=16) - timedelta(days=1)
|
||||
if role_template.end_time < role_template.start_time:
|
||||
end_time = current_datetime.replace(hour=end_hour) + timedelta(days=1, hours=16) - timedelta(days=1)
|
||||
else:
|
||||
end_time = current_datetime.replace(hour=end_hour) + timedelta(hours=16) - timedelta(days=1)
|
||||
self.env['planning.slot'].create({
|
||||
'resource_id': record.employee_id.resource_id.id,
|
||||
'template_id': role_template.id,
|
||||
'role_id': role.id,
|
||||
'start_datetime': start_time,
|
||||
'end_datetime': end_time,
|
||||
'allocated_hours': 8,
|
||||
})
|
||||
|
||||
class CustomerPlanLine(models.Model):
|
||||
_name = 'customer.plan.line'
|
||||
_description = '客户排班计划明细'
|
||||
|
||||
sequence = fields.Char(string='序号', store=True)
|
||||
customer_plan_id = fields.Many2one('yuthon.customer.planning', string='关联计划名称')
|
||||
employee_id = fields.Many2one('hr.employee', string='值班人员')
|
||||
@@ -15,10 +15,10 @@ class YuthonDutyPlan(models.Model):
|
||||
plan_line_ids = fields.One2many('duty.plan.line', 'duty_plan_id', string='关联计划明细')
|
||||
white_line_ids = fields.One2many('white.plan.line', 'duty_plan_id', string='关联计划明细')
|
||||
notice = fields.Text(string='计划说明')
|
||||
select_time = fields.Selection([('January', '一月'), ('February', '二月'), ('March', '三月'), ('April', '四月'),
|
||||
('May', '五月'), ('June', '六月'), ('July', '七月'), ('August', '八月'),
|
||||
('September', '九月'), ('October', '十月'), ('November', '十一月'),
|
||||
('December', '十二月')], string='选择月份')
|
||||
select_time = fields.Selection([('1', '一月'), ('2', '二月'), ('3', '三月'), ('4', '四月'),
|
||||
('5', '五月'), ('6', '六月'), ('7', '七月'), ('8', '八月'),
|
||||
('9', '九月'), ('10', '十月'), ('11', '十一月'),
|
||||
('12', '十二月')], string='选择月份')
|
||||
# default = lambda self: self._default_month()
|
||||
# @api.model
|
||||
# def _default_month(self):
|
||||
@@ -26,14 +26,7 @@ class YuthonDutyPlan(models.Model):
|
||||
# return current_month
|
||||
|
||||
def auto_duty_plan(self, next_date=False):
|
||||
month_names = {
|
||||
'January': 1, 'February': 2, 'March': 3, 'April': 4,
|
||||
'May': 5, 'June': 6, 'July': 7, 'August': 8,
|
||||
'September': 9, 'October': 10, 'November': 11, 'December': 12
|
||||
}
|
||||
current_month = datetime.now().month
|
||||
current_year = datetime.now().year
|
||||
selected_month = month_names.get(self.select_time)
|
||||
selected_month = int(self.select_time)
|
||||
year = datetime.now().year
|
||||
if not next_date:
|
||||
first_day_of_month = datetime(year, selected_month, 1)
|
||||
@@ -42,12 +35,13 @@ class YuthonDutyPlan(models.Model):
|
||||
next_year = year + (1 if next_month == 1 else 0) # 如果是12月,年份加1
|
||||
last_day_of_month = datetime(next_year, next_month, 1)
|
||||
else:
|
||||
next_month = (current_month % 12) + 1
|
||||
next_year = current_year + (1 if next_month == 1 else 0)
|
||||
first_day_of_month = datetime(next_year, next_month, 1) # Next month's first day
|
||||
next_month = (selected_month % 12) + 1
|
||||
next_year = year + (1 if next_month == 1 else 0)
|
||||
first_day_of_month = datetime(next_year, next_month, 1)
|
||||
next_next_month = (next_month % 12) + 1
|
||||
next_next_year = next_year + (1 if next_next_month == 1 else 0)
|
||||
last_day_of_month = datetime(next_next_year, next_next_month, 1)
|
||||
|
||||
role_a = self.env['planning.role'].search([('name', '=', '联安粮库')], limit=1)
|
||||
role_template_a = self.env['planning.slot.template'].search([('planning_name', '=', '白班'), ('role_id', '=', role_a.id)])
|
||||
role_template_b = self.env['planning.slot.template'].search([('planning_name', '=', '白值'), ('role_id', '=', role_a.id)])
|
||||
@@ -100,7 +94,6 @@ class YuthonDutyPlan(models.Model):
|
||||
if week == 5 or week == 6:
|
||||
i.sudo().unlink()
|
||||
|
||||
|
||||
other_data = {}
|
||||
for other in self.white_line_ids:
|
||||
if other.employee_id:
|
||||
|
||||
@@ -15,21 +15,13 @@ class YuthonRunPlanning(models.Model):
|
||||
all_run_ids = fields.One2many('yuthon.all.run.line', 'engineering_planning_id', string='关联综合部排班明细')
|
||||
other_run_ids = fields.One2many('yuthon.other.line', 'engineering_planning_id', string='关联其他明细')
|
||||
department_id = fields.Many2one("hr.department", string="部门", required=True)
|
||||
select_time = fields.Selection([('January', '一月'), ('February', '二月'), ('March', '三月'), ('April', '四月'),
|
||||
('May', '五月'), ('June', '六月'), ('July', '七月'), ('August', '八月'),
|
||||
('September', '九月'), ('October', '十月'), ('November', '十一月'),
|
||||
('December', '十二月')], string='选择月份')
|
||||
|
||||
select_time = fields.Selection([('1', '一月'), ('2', '二月'), ('3', '三月'), ('4', '四月'),
|
||||
('5', '五月'), ('6', '六月'), ('7', '七月'), ('8', '八月'),
|
||||
('9', '九月'), ('10', '十月'), ('11', '十一月'),
|
||||
('12', '十二月')], string='选择月份')
|
||||
# 运行班
|
||||
def run_confirm(self,next_date=False):
|
||||
month_names = {
|
||||
'January': 1, 'February': 2, 'March': 3, 'April': 4,
|
||||
'May': 5, 'June': 6, 'July': 7, 'August': 8,
|
||||
'September': 9, 'October': 10, 'November': 11, 'December': 12
|
||||
}
|
||||
current_month = datetime.now().month
|
||||
current_year = datetime.now().year
|
||||
selected_month = month_names.get(self.select_time)
|
||||
selected_month = int(self.select_time)
|
||||
year = datetime.now().year
|
||||
if not next_date:
|
||||
first_day_of_month = datetime(year, selected_month, 1)
|
||||
@@ -38,12 +30,13 @@ class YuthonRunPlanning(models.Model):
|
||||
next_year = year + (1 if next_month == 1 else 0) # 如果是12月,年份加1
|
||||
last_day_of_month = datetime(next_year, next_month, 1)
|
||||
else:
|
||||
next_month = (current_month % 12) + 1
|
||||
next_year = current_year + (1 if next_month == 1 else 0)
|
||||
first_day_of_month = datetime(next_year, next_month, 1) # Next month's first day
|
||||
next_month = (selected_month % 12) + 1
|
||||
next_year = year + (1 if next_month == 1 else 0)
|
||||
first_day_of_month = datetime(next_year, next_month, 1)
|
||||
next_next_month = (next_month % 12) + 1
|
||||
next_next_year = next_year + (1 if next_next_month == 1 else 0)
|
||||
last_day_of_month = datetime(next_next_year, next_next_month, 1)
|
||||
|
||||
role_a = self.env['planning.role'].search([('name', '=', '工程部')], limit=1)
|
||||
start_time = int(self.env['planning.slot.template'].search([('role_id', '=', role_a.id), ('planning_name', '=', '白班')]).start_time)
|
||||
end_time = int(self.env['planning.slot.template'].search([('role_id', '=', role_a.id), ('planning_name', '=', '白班')]).end_time)
|
||||
@@ -128,14 +121,7 @@ class YuthonRunPlanning(models.Model):
|
||||
}
|
||||
# 高压班
|
||||
def high_confirm(self,next_date=False):
|
||||
month_names = {
|
||||
'January': 1, 'February': 2, 'March': 3, 'April': 4,
|
||||
'May': 5, 'June': 6, 'July': 7, 'August': 8,
|
||||
'September': 9, 'October': 10, 'November': 11, 'December': 12
|
||||
}
|
||||
current_month = datetime.now().month
|
||||
current_year = datetime.now().year
|
||||
selected_month = month_names.get(self.select_time)
|
||||
selected_month = int(self.select_time)
|
||||
year = datetime.now().year
|
||||
if not next_date:
|
||||
first_day_of_month = datetime(year, selected_month, 1)
|
||||
@@ -144,9 +130,9 @@ class YuthonRunPlanning(models.Model):
|
||||
next_year = year + (1 if next_month == 1 else 0) # 如果是12月,年份加1
|
||||
last_day_of_month = datetime(next_year, next_month, 1)
|
||||
else:
|
||||
next_month = (current_month % 12) + 1
|
||||
next_year = current_year + (1 if next_month == 1 else 0)
|
||||
first_day_of_month = datetime(next_year, next_month, 1) # Next month's first day
|
||||
next_month = (selected_month % 12) + 1
|
||||
next_year = year + (1 if next_month == 1 else 0)
|
||||
first_day_of_month = datetime(next_year, next_month, 1)
|
||||
next_next_month = (next_month % 12) + 1
|
||||
next_next_year = next_year + (1 if next_next_month == 1 else 0)
|
||||
last_day_of_month = datetime(next_next_year, next_next_month, 1)
|
||||
@@ -212,14 +198,7 @@ class YuthonRunPlanning(models.Model):
|
||||
}
|
||||
# 综合班
|
||||
def integrated_confirm(self,next_date=False):
|
||||
month_names = {
|
||||
'January': 1, 'February': 2, 'March': 3, 'April': 4,
|
||||
'May': 5, 'June': 6, 'July': 7, 'August': 8,
|
||||
'September': 9, 'October': 10, 'November': 11, 'December': 12
|
||||
}
|
||||
current_month = datetime.now().month
|
||||
current_year = datetime.now().year
|
||||
selected_month = month_names.get(self.select_time)
|
||||
selected_month = int(self.select_time)
|
||||
year = datetime.now().year
|
||||
if not next_date:
|
||||
first_day_of_month = datetime(year, selected_month, 1)
|
||||
@@ -228,9 +207,9 @@ class YuthonRunPlanning(models.Model):
|
||||
next_year = year + (1 if next_month == 1 else 0) # 如果是12月,年份加1
|
||||
last_day_of_month = datetime(next_year, next_month, 1)
|
||||
else:
|
||||
next_month = (current_month % 12) + 1
|
||||
next_year = current_year + (1 if next_month == 1 else 0)
|
||||
first_day_of_month = datetime(next_year, next_month, 1) # Next month's first day
|
||||
next_month = (selected_month % 12) + 1
|
||||
next_year = year + (1 if next_month == 1 else 0)
|
||||
first_day_of_month = datetime(next_year, next_month, 1)
|
||||
next_next_month = (next_month % 12) + 1
|
||||
next_next_year = next_year + (1 if next_next_month == 1 else 0)
|
||||
last_day_of_month = datetime(next_next_year, next_next_month, 1)
|
||||
|
||||
@@ -14,20 +14,13 @@ class YuthonShiftPlanning(models.Model):
|
||||
planning_c_ids = fields.One2many('yuthon.shift.planning.c.line', 'shift_planning_id', string='关联C组')
|
||||
planning_ever_white_ids = fields.One2many('yuthon.shift.ever.white.line', 'shift_planning_id', string='关联常白班')
|
||||
planning_ever_noon_ids = fields.One2many('yuthon.shift.ever.noon.line', 'shift_planning_id', string='关联常中班')
|
||||
select_time = fields.Selection([('January', '一月'), ('February', '二月'), ('March', '三月'), ('April', '四月'),
|
||||
('May', '五月'), ('June', '六月'), ('July', '七月'), ('August', '八月'),
|
||||
('September', '九月'), ('October', '十月'), ('November', '十一月'),
|
||||
('December', '十二月')], string='选择月份')
|
||||
select_time = fields.Selection([('1', '一月'), ('2', '二月'), ('3', '三月'), ('4', '四月'),
|
||||
('5', '五月'), ('6', '六月'), ('7', '七月'), ('8', '八月'),
|
||||
('9', '九月'), ('10', '十月'), ('11', '十一月'),
|
||||
('12', '十二月')], string='选择月份', default=lambda self: self._get_default_month())
|
||||
|
||||
def confirm(self,next_date=False):
|
||||
month_names = {
|
||||
'January': 1, 'February': 2, 'March': 3, 'April': 4,
|
||||
'May': 5, 'June': 6, 'July': 7, 'August': 8,
|
||||
'September': 9, 'October': 10, 'November': 11, 'December': 12
|
||||
}
|
||||
current_month = datetime.now().month
|
||||
current_year = datetime.now().year
|
||||
selected_month = month_names.get(self.select_time)
|
||||
selected_month = int(self.select_time)
|
||||
year = datetime.now().year
|
||||
if not next_date:
|
||||
start_date = datetime(year, selected_month, 1)
|
||||
@@ -36,9 +29,9 @@ class YuthonShiftPlanning(models.Model):
|
||||
next_year = year + (1 if next_month == 1 else 0) # 如果是12月,年份加1
|
||||
end_date = datetime(next_year, next_month, 1)
|
||||
else:
|
||||
next_month = (current_month % 12) + 1
|
||||
next_year = current_year + (1 if next_month == 1 else 0)
|
||||
start_date = datetime(next_year, next_month, 1) # Next month's first day
|
||||
next_month = (selected_month % 12) + 1
|
||||
next_year = year + (1 if next_month == 1 else 0)
|
||||
start_date = datetime(next_year, next_month, 1)
|
||||
next_next_month = (next_month % 12) + 1
|
||||
next_next_year = next_year + (1 if next_next_month == 1 else 0)
|
||||
end_date = datetime(next_next_year, next_next_month, 1)
|
||||
@@ -166,6 +159,10 @@ class YuthonShiftPlanning(models.Model):
|
||||
for data in white_data:
|
||||
record.planning_ever_noon_ids = [(0, 0, data)]
|
||||
|
||||
def _get_default_month(self):
|
||||
current_month = datetime.now().month
|
||||
return str(current_month) # 返回字符串类型的月份
|
||||
|
||||
class YuthonShiftPlanningALine(models.Model):
|
||||
_name = 'yuthon.shift.planning.a.line'
|
||||
_description = '排班安排A组'
|
||||
|
||||
@@ -32,4 +32,6 @@ access_yuthon_abnormal_approval,yuthon.abnormal.approval,model_yuthon_abnormal_a
|
||||
access_yuthon_abnormal_setting,yuthon.abnormal.setting,model_yuthon_abnormal_setting,base.group_user,1,1,1,1
|
||||
access_yuthon_shift_approval,yuthon.shift.approval,model_yuthon_shift_approval,base.group_user,1,1,1,1
|
||||
access_yuthon_special_approval,yuthon.special.approval,model_yuthon_special_approval,base.group_user,1,1,1,1
|
||||
access_card_remind_form,card.remind.form,model_card_remind_form,base.group_user,1,1,1,1
|
||||
access_card_remind_form,card.remind.form,model_card_remind_form,base.group_user,1,1,1,1
|
||||
access_yuthon_customer_planning,yuthon.customer.planning,model_yuthon_customer_planning,base.group_user,1,1,1,1
|
||||
access_customer_plan_line,customer.plan.line,model_customer_plan_line,base.group_user,1,1,1,1
|
||||
|
@@ -126,6 +126,38 @@
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<!--客服中心-->
|
||||
<record id="view_attendance_going_tree6" model="ir.ui.view">
|
||||
<field name="name">hr.attendance.going.tree5</field>
|
||||
<field name="model">hr.attendance</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="出勤" decoration-danger="abnormal == 1"
|
||||
edit="false" delete="false" create="false"
|
||||
editable="bottom" banner_route="/attendance/banner/route">
|
||||
<field name="employee_id" widget="many2one_avatar_user"/>
|
||||
<field name="is_no_card" optional="show" class="list_width"/>
|
||||
<field name="is_early_card" optional="show" class="list_width"/>
|
||||
<field name="is_late_card" optional="show" class="list_width"/>
|
||||
<field name="is_abnormal" optional="show" class="list_width"/>
|
||||
<field name="week" optional="show"/>
|
||||
<field name="abnormal" optional="show" column_invisible="1"/>
|
||||
<field name="work_time_type" optional="hidden"/>
|
||||
<field name="check_in" optional="show" widget="time"/>
|
||||
<field name="noon_duty" optional="show" widget="time"/>
|
||||
<field name="check_out" optional="show" widget="time"/>
|
||||
<field name="shift_name" optional="show"/>
|
||||
<field name="is_approval" column_invisible="1"/>
|
||||
<button name="button_leave" type="object" string="请假" class="oe_highlight"
|
||||
invisible="not is_abnormal"/>
|
||||
<button name="button_card_approval" type="object" string="补卡" class="oe_highlight"
|
||||
invisible="not is_abnormal"/>
|
||||
<button name="button_duty_approval" type="object" string="外出" class="oe_highlight"
|
||||
invisible="not is_abnormal"/>
|
||||
<button name="button_correct_approval" type="object" string="修正" class="oe_highlight"
|
||||
invisible="not is_abnormal"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_attendance_going_action" model="ir.actions.act_window">
|
||||
<field name="name">出勤</field>
|
||||
@@ -206,4 +238,13 @@
|
||||
<field name="view_ids" eval="[(5, 0, 0),
|
||||
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_hr_attendance.view_attendance_going_tree5')})]"/>
|
||||
</record>
|
||||
<record id="hr_attendance_action5" model="ir.actions.act_window">
|
||||
<field name="name">考勤记录</field>
|
||||
<field name="res_model">hr.attendance</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="context">{"search_default_employee": 1}</field>
|
||||
<field name="domain">[('employee_id.department_id.name','=','客服中心')]]</field>
|
||||
<field name="view_ids" eval="[(5, 0, 0),
|
||||
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_hr_attendance.view_attendance_going_tree6')})]"/>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
@@ -31,4 +31,10 @@
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="domain">[('department_id.name', '=', '联安粮库')]</field>
|
||||
</record>
|
||||
<record id="action_planning_role_form4" model="ir.actions.act_window">
|
||||
<field name="name">班次名称</field>
|
||||
<field name="res_model">planning.role</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="domain">[('department_id.name', '=', '客服中心')]</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -45,4 +45,10 @@
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('department_id.name', '=', '联安粮库')]</field>
|
||||
</record>
|
||||
<record id="action_planning_slot_template_form4" model="ir.actions.act_window">
|
||||
<field name="name">班次模板</field>
|
||||
<field name="res_model">planning.slot.template</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('department_id.name', '=', '客服中心')]</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -104,4 +104,11 @@
|
||||
<field name="context">{'planning_expand_resource': 1, 'planning_expand_role': 1}</field>
|
||||
<field name="domain">[('department_id.name','in',['仓储组', '综合组','保管组', '机安组', '1库', '2库', '3库', '联安粮库'])]]</field>
|
||||
</record>
|
||||
<record id="action_planning_slot_form7" model="ir.actions.act_window">
|
||||
<field name="name">客服中心</field>
|
||||
<field name="res_model">planning.slot</field>
|
||||
<field name="view_mode">gantt,calendar,tree,form,kanban,pivot,graph</field>
|
||||
<field name="context">{'planning_expand_resource': 1, 'planning_expand_role': 1}</field>
|
||||
<field name="domain">[('department_id.name','=', '客服中心')]</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record id="view_yuthon_customer_planning_tree" model="ir.ui.view">
|
||||
<field name="name">yuthon.customer.planning.tree</field>
|
||||
<field name="model">yuthon.customer.planning</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="排版规则">
|
||||
<field name="name"/>
|
||||
<field name="start_index_time"/>
|
||||
<field name="end_index_time"/>
|
||||
<field name="is_enable"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_yuthon_customer_planning_form" model="ir.ui.view">
|
||||
<field name="name">yuthon.customer.planning.form</field>
|
||||
<field name="model">yuthon.customer.planning</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="排版规则">
|
||||
<header>
|
||||
<button name="auto_customer_plan" type="object" string="安排值班" class="oe_highlight"/>
|
||||
<button name="customer_next_plan" type="object" string="安排下个月值班" class="oe_highlight"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<label for="name" placeholder="请输入标题"/>
|
||||
<h1>
|
||||
<field name="name" required="1"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="notice"/>
|
||||
<field name="select_time" required="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="start_index_time"/>
|
||||
<field name="end_index_time"/>
|
||||
<field name="is_enable"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="值班人员">
|
||||
<field name="plan_line_ids">
|
||||
<tree editable="bottom">
|
||||
<field name="customer_plan_id" column_invisible="1"/>
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="employee_id" required="1"
|
||||
domain="[('department_id.name', '=', '客服中心')]"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="yuthon_customer_planning_view_action" model="ir.actions.act_window">
|
||||
<field name="name">排版规则</field>
|
||||
<field name="res_model">yuthon.customer.planning</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -31,7 +31,7 @@
|
||||
<group>
|
||||
<group>
|
||||
<field name="notice"/>
|
||||
<field name="select_time"/>
|
||||
<field name="select_time" required="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="start_index_time"/>
|
||||
@@ -39,31 +39,21 @@
|
||||
<field name="is_enable"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="值班人员"/>
|
||||
<div>
|
||||
<field name="plan_line_ids">
|
||||
<tree editable="bottom">
|
||||
<field name="duty_plan_id" column_invisible="1"/>
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="employee_ids" required="1"
|
||||
domain="[('department_id.name', 'in', ['仓储组', '综合组','保管组', '机安组','1库', '2库', '3库','联安粮库'])]"
|
||||
widget="many2many_tags"/>
|
||||
<field name="duty_class_id" required="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</div>
|
||||
<group string="常白人员"/>
|
||||
<div>
|
||||
<field name="white_line_ids">
|
||||
<tree editable="bottom">
|
||||
<field name="duty_plan_id" column_invisible="1"/>
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="employee_id" required="1"
|
||||
domain="[('department_id.name', 'in', ['仓储组', '综合组','保管组', '机安组','1库', '2库', '3库','联安粮库'])]"/>
|
||||
<field name="regular_holidays"/>
|
||||
</tree>
|
||||
</field>
|
||||
</div>
|
||||
<notebook>
|
||||
<page string="值班人员">
|
||||
<field name="plan_line_ids">
|
||||
<tree editable="bottom">
|
||||
<field name="duty_plan_id" column_invisible="1"/>
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="employee_ids" required="1"
|
||||
domain="[('department_id.name', 'in', ['仓储组', '综合组','保管组',
|
||||
'机安组','1库', '2库', '3库','联安粮库'])]"
|
||||
widget="many2many_tags"/>
|
||||
<field name="duty_class_id" required="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="illustrate"/>
|
||||
<field name="select_time"/>
|
||||
<field name="select_time" required="1"/>
|
||||
<field name="department_id"/>
|
||||
</group>
|
||||
<group string="运行班排班">
|
||||
@@ -74,7 +74,7 @@
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="illustrate"/>
|
||||
<field name="select_time"/>
|
||||
<field name="select_time" required="1"/>
|
||||
<field name="department_id"/>
|
||||
</group>
|
||||
<group string="综合班排班">
|
||||
@@ -114,7 +114,7 @@
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="illustrate"/>
|
||||
<field name="select_time"/>
|
||||
<field name="select_time" required="1"/>
|
||||
<field name="department_id"/>
|
||||
</group>
|
||||
<group string="高压班排班">
|
||||
|
||||
@@ -100,6 +100,11 @@
|
||||
name="排班计划"
|
||||
parent="menu_hr_attendance_engineering_record_board"
|
||||
sequence="3"/>
|
||||
<menuitem id="menu_hr_plan_sources_all_board"
|
||||
name="全部"
|
||||
parent="menu_hr_attendance_all_planning_board"
|
||||
action="yuthon_hr_attendance.action_planning_slot_form2"
|
||||
sequence="1"/>
|
||||
<menuitem id="menu_hr_plan_sources_all_board1"
|
||||
name="运行班计划"
|
||||
parent="menu_hr_attendance_all_planning_board"
|
||||
@@ -219,6 +224,36 @@
|
||||
parent="menu_yuthon_duty_summary_setting"
|
||||
sequence="15"
|
||||
action="yuthon_hr_attendance.view_yuthon_abnormal_setting_action"/>
|
||||
<!--客服计划-->
|
||||
<menuitem id="menu_hr_attendance_customer_board"
|
||||
name="客服计划"
|
||||
parent="hr_attendance_root_board"
|
||||
sequence="12"/>
|
||||
<menuitem id="menu_hr_attendance_customer_flow_board"
|
||||
name="排班规则"
|
||||
parent="menu_hr_attendance_customer_board"
|
||||
action="yuthon_hr_attendance.yuthon_customer_planning_view_action"
|
||||
sequence="1"/>
|
||||
<menuitem id="menu_hr_attendance_customer_summary_board"
|
||||
name="排班计划"
|
||||
parent="menu_hr_attendance_customer_board"
|
||||
action="yuthon_hr_attendance.action_planning_slot_form7"
|
||||
sequence="3"/>
|
||||
<menuitem id="menu_hr_attendance_duty_customer_record_board"
|
||||
name="考勤记录"
|
||||
parent="menu_hr_attendance_customer_board"
|
||||
action="yuthon_hr_attendance.hr_attendance_action5"
|
||||
sequence="3"/>
|
||||
<menuitem id="menu_yuthon_customer_planning_board"
|
||||
name="班次名称"
|
||||
parent="menu_hr_attendance_customer_board"
|
||||
action="yuthon_hr_attendance.action_planning_role_form4"
|
||||
sequence="5"/>
|
||||
<menuitem id="menu_yuthon_customer_action_planning_template_board"
|
||||
name="班次模板"
|
||||
parent="menu_hr_attendance_customer_board"
|
||||
action="yuthon_hr_attendance.action_planning_slot_template_form4"
|
||||
sequence="13"/>
|
||||
|
||||
<!-- 计划相关 -->
|
||||
<menuitem id="menu_hr_attendance_approval_request_board"
|
||||
|
||||
Reference in New Issue
Block a user