添加功能
This commit is contained in:
@@ -13,9 +13,8 @@ class YuthonRunPlanning(models.Model):
|
||||
high_run_ids = fields.One2many('yuthon.high.run.line', 'engineering_planning_id', string='关联高压班排班明细')
|
||||
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_run_id = fields.Many2one("hr.department", string="部门", required=True, default=lambda self: self.env['hr.department'].search([('name', '=', '运行班')]))
|
||||
department_high_id = fields.Many2one("hr.department", string="部门", required=True, default=lambda self: self.env['hr.department'].search([('name', '=', '高压班')]))
|
||||
department_integrated_id = fields.Many2one("hr.department", string="部门", required=True, default=lambda self: self.env['hr.department'].search([('name', '=', '综合班')]))
|
||||
department_id = fields.Many2one("hr.department", string="部门", required=True)
|
||||
|
||||
# 运行班
|
||||
def run_confirm(self):
|
||||
today = datetime.today().date()
|
||||
|
||||
@@ -63,6 +63,12 @@
|
||||
<field name="res_model">hr.attendance</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<record id="hr_attendance.hr_attendance_action" 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="domain">[('employee_id.resource_calendar_id.name', '=', '行政考勤')]</field>
|
||||
</record>
|
||||
<record id="hr_attendance_action1" model="ir.actions.act_window">
|
||||
<field name="name">我的考勤</field>
|
||||
<field name="res_model">hr.attendance</field>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="illustrate"/>
|
||||
<field name="department_run_id"/>
|
||||
<field name="department_id"/>
|
||||
</group>
|
||||
<group string="运行班安排">
|
||||
<field name="engineering_run_ids" string=" ">
|
||||
@@ -71,7 +71,7 @@
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="illustrate"/>
|
||||
<field name="department_integrated_id"/>
|
||||
<field name="department_id"/>
|
||||
</group>
|
||||
<group string="综合班安排">
|
||||
<field name="all_run_ids" string=" ">
|
||||
@@ -109,7 +109,7 @@
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="illustrate"/>
|
||||
<field name="department_high_id"/>
|
||||
<field name="department_id"/>
|
||||
</group>
|
||||
<group string="高压班安排">
|
||||
<field name="high_run_ids" string=" ">
|
||||
@@ -124,11 +124,16 @@
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_yuthon_all_planning" model="ir.actions.act_window">
|
||||
<field name="name">全部</field>
|
||||
<field name="res_model">yuthon.run.planning</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<record id="action_yuthon_run_planning" model="ir.actions.act_window">
|
||||
<field name="name">运行班安排</field>
|
||||
<field name="res_model">yuthon.run.planning</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('department_run_id.name', '=', '运行班')]</field>
|
||||
<field name="domain">[('department_id.name', '=', '运行班')]</field>
|
||||
<field name="view_ids" eval="[(5, 0, 0),
|
||||
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_hr_attendance.view_yuthon_run_planning_tree')}),
|
||||
(0, 0, {'view_mode': 'form', 'view_id': ref('yuthon_hr_attendance.view_yuthon_run_planning_form')})]"/>
|
||||
@@ -137,7 +142,7 @@
|
||||
<field name="name">综合部安排</field>
|
||||
<field name="res_model">yuthon.run.planning</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('department_high_id.name', '=', '综合班')]</field>
|
||||
<field name="domain">[('department_id.name', '=', '综合班')]</field>
|
||||
<field name="view_ids" eval="[(5, 0, 0),
|
||||
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_hr_attendance.view_yuthon_integrated_planning_tree')}),
|
||||
(0, 0, {'view_mode': 'form', 'view_id': ref('yuthon_hr_attendance.view_yuthon_integrated_planning_form')})]"/>
|
||||
@@ -146,7 +151,7 @@
|
||||
<field name="name">高压部安排</field>
|
||||
<field name="res_model">yuthon.run.planning</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('department_integrated_id.name', '=', '高压班')]</field>
|
||||
<field name="domain">[('department_id.name', '=', '高压班')]</field>
|
||||
<field name="view_ids" eval="[(5, 0, 0),
|
||||
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_hr_attendance.view_yuthon_high_planning_tree')}),
|
||||
(0, 0, {'view_mode': 'form', 'view_id': ref('yuthon_hr_attendance.view_yuthon_high_planning_form')})]"/>
|
||||
|
||||
@@ -32,8 +32,7 @@ class YuthonHrEmployeeTimeWizard(models.Model):
|
||||
|
||||
def confirm(self):
|
||||
for employee_id in self.employee_ids:
|
||||
if employee_id.resource_calendar_id:
|
||||
employee_id.write({
|
||||
'resource_calendar_id': self.attendance_id.id})
|
||||
if self.attendance_id:
|
||||
employee_id.write({'resource_calendar_id': self.attendance_id.id})
|
||||
else:
|
||||
pass
|
||||
employee_id.write({'resource_calendar_id': False})
|
||||
@@ -79,21 +79,26 @@
|
||||
name="排班安排"
|
||||
parent="menu_hr_attendance_engineering_record_board"
|
||||
sequence="1"/>
|
||||
<menuitem id="menu_hr_attendance_planning_all_record_board"
|
||||
name="全部"
|
||||
parent="menu_hr_attendance_all_board"
|
||||
action="yuthon_hr_attendance.action_yuthon_all_planning"
|
||||
sequence="1"/>
|
||||
<menuitem id="menu_hr_attendance_planning_run_board"
|
||||
name="运行班"
|
||||
parent="menu_hr_attendance_all_board"
|
||||
action="yuthon_hr_attendance.action_yuthon_run_planning"
|
||||
sequence="1"/>
|
||||
sequence="3"/>
|
||||
<menuitem id="menu_hr_attendance_planning_high_board"
|
||||
name="高压班"
|
||||
parent="menu_hr_attendance_all_board"
|
||||
action="yuthon_hr_attendance.action_yuthon_high_planning"
|
||||
sequence="3"/>
|
||||
sequence="5"/>
|
||||
<menuitem id="menu_hr_attendance_planning_integrated_board"
|
||||
name="综合班"
|
||||
parent="menu_hr_attendance_all_board"
|
||||
action="yuthon_hr_attendance.action_yuthon_integrated_planning"
|
||||
sequence="5"/>
|
||||
sequence="7"/>
|
||||
|
||||
<menuitem id="menu_hr_plan_sources_board3"
|
||||
name="排班计划"
|
||||
@@ -239,11 +244,6 @@
|
||||
name="流程"
|
||||
parent="hr_attendance_root_board"
|
||||
sequence="15"/>
|
||||
<menuitem id="menu_hr_attendance_scheme_request_board"
|
||||
name="考勤方案"
|
||||
parent="menu_hr_attendance_approval_request_board"
|
||||
action="yuthon_hr_attendance.attendance_scheme_action"
|
||||
sequence="1"/>
|
||||
<menuitem id="menu_hr_attendance_overtime_board"
|
||||
name="加班申请"
|
||||
parent="menu_hr_attendance_approval_request_board"
|
||||
|
||||
Reference in New Issue
Block a user