pengyuthon wechat

This commit is contained in:
李鹏宇
2024-12-02 14:52:20 +00:00
committed by 李鹏宇
parent 17f5f2f2dc
commit a3e3ff2cd8
21 changed files with 171 additions and 319 deletions
-1
View File
@@ -1,2 +1 @@
from . import models
from . import wizard
+1 -3
View File
@@ -11,7 +11,7 @@
'sequence': 240,
'website': 'https://www.pengyuthon.com',
'depends': ['hr_attendance', 'resource', 'base', 'hr', 'mail',
'soong_workflow', 'yuthon_issue', 'planning', 'calendar'],
'soong_workflow', 'yuthon_issue','calendar'],
'data': [
'security/ir.model.access.csv',
'data/arrangement_time_data.xml',
@@ -25,8 +25,6 @@
'views/yuthon_abnormal_setting_views.xml',
'views/yuthon_adjustments_approval_views.xml',
'views/yuthon_shift_approval_views.xml',
'wizard/yuthon_duty_arrangement_wizard_views.xml',
'wizard/yuthon_duty_summary_wizard_views.xml',
],
'installable': True,
'application': True,
@@ -9,8 +9,8 @@ class YuthonDutyArrangement(models.Model):
_order = 'start_time desc'
_rec_name = 'employee_id'
employee_id = fields.Many2one('hr.employee', string='员工',
domain=lambda self: [('department_id.name', '=', '仓储组')])
employee_id = fields.Many2one('hr.employee', string='员工')
duty_class_id = fields.Many2one('yuthon.duty.class.setting', string="班组名称")
start_time = fields.Date(string="开始日期")
end_time = fields.Date(string="结束日期")
remarks = fields.Text(string='备注')
@@ -101,3 +101,6 @@ class YuthonDutyArrangement(models.Model):
title="值班安排",
description='本月的值班表已确认,请查看',
url=str, btntxt="详细信息")
def button_all_duty(self):
pass
+32 -18
View File
@@ -12,30 +12,44 @@ class YuthonDutyPlan(models.Model):
end_index_time = fields.Date(string='失效时间')
is_enable = fields.Boolean(string="启用", default=True)
plan_line_ids = fields.One2many('duty.plan.line', 'duty_plan_id', string='关联计划明细')
notice = fields.Text(string='计划说明')
def auto_duty_plan(self):
employee_ids = self.env['hr.employee'].search([('department_id.name', 'in', ['仓储组', '综合组', '保管组', '机安组',
'1库', '2库', '3库', '联安粮库'])])
self.plan_line_ids.unlink()
sequence = 1
for employee in employee_ids:
self.env['duty.plan.line'].create({
'duty_plan_id': self.id,
'sequence': sequence,
'employee_id': employee.id
})
sequence += 1
today = datetime.today().date()
first_day_of_month = today.replace(day=1)
if today.month < 12:
last_day_of_month = (today.replace(month=today.month + 1, day=1) - timedelta(days=1))
else:
last_day_of_month = (today.replace(year=today.year + 1, month=1, day=1) - timedelta(days=1))
duty_lines = []
current_date = first_day_of_month
while current_date <= last_day_of_month:
for line in self.plan_line_ids:
for employee in line.employee_ids:
duty_lines.append({
'employee_id': employee.id,
'start_time': current_date,
'end_time': current_date,
'duty_class_id': line.duty_class_id.id,
})
current_date += timedelta(days=1)
if current_date > last_day_of_month:
break
self.env['yuthon.duty.arrangement'].create(duty_lines)
tree_id = self.env.ref("yuthon_duty_plan.view_yuthon_duty_arrangement_tree").id
return {
"type": "ir.actions.act_window",
"name": "值班安排",
"res_model": "yuthon.duty.arrangement",
"views": [[tree_id, "tree"]],
}
class DutyPlanLine(models.Model):
_name = 'duty.plan.line'
_description = '值班计划明细行'
_order = 'sequence asc'
sequence = fields.Char(string='序号', store=True)
duty_plan_id = fields.Many2one('yuthon.duty.plan', string='关联计划名称')
sequence = fields.Integer(string='序号')
employee_id = fields.Many2one('hr.employee', string='员工',
domain=lambda self: [('department_id.name', 'in', ['仓储组', '综合组',
'保管组', '机安组',
'1库', '2库', '3库',
'联安粮库'])])
employee_ids = fields.Many2many('hr.employee', string='值班人员')
duty_class_id = fields.Many2one('yuthon.duty.class.setting', string="班组名称")
@@ -6,3 +6,11 @@ class YuthonDutySetting(models.Model):
_description = '值班说明配置'
reason_application = fields.Html(string="说明")
class YuthonDutyClassSetting(models.Model):
_name = 'yuthon.duty.class.setting'
_description = '值班班组配置'
_rec_name = 'name'
name = fields.Char(string="班组名称")
@@ -1,14 +1,10 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_yuthon_duty_arrangement,yuthon.duty.arrangement,model_yuthon_duty_arrangement,base.group_user,1,1,1,1
access_yuthon_duty_arrangement_wizard,yuthon.duty.arrangement.wizard,model_yuthon_duty_arrangement_wizard,base.group_user,1,1,1,1
access_yuthon_duty_plan,yuthon.duty.plan,model_yuthon_duty_plan,base.group_user,1,1,1,1
access_duty_plan_line,duty.plan.line,model_duty_plan_line,base.group_user,1,1,1,1
access_yuthon_duty_setting,yuthon.duty.setting,model_yuthon_duty_setting,base.group_user,1,1,1,1
access_yuthon_duty_class_setting,yuthon.duty.class.setting,model_yuthon_duty_class_setting,base.group_user,1,1,1,1
access_yuthon_duty_summary,yuthon.duty.summary,model_yuthon_duty_summary,base.group_user,1,1,1,1
access_yuthon_duty_summary_wizard,yuthon.duty.summary.wizard,model_yuthon_duty_summary_wizard,base.group_user,1,1,1,1
access_duty_approval_line,duty.approval.line,model_duty_approval_line,base.group_user,1,1,1,1
access_yuthon_adjustments_approval,yuthon.adjustments.approval,model_yuthon_adjustments_approval,base.group_user,1,1,1,1
access_yuthon_abnormal_approval,yuthon.abnormal.approval,model_yuthon_abnormal_approval,base.group_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_yuthon_duty_arrangement yuthon.duty.arrangement model_yuthon_duty_arrangement base.group_user 1 1 1 1
access_yuthon_duty_arrangement_wizard yuthon.duty.arrangement.wizard model_yuthon_duty_arrangement_wizard base.group_user 1 1 1 1
3 access_yuthon_duty_plan yuthon.duty.plan model_yuthon_duty_plan base.group_user 1 1 1 1
4 access_duty_plan_line duty.plan.line model_duty_plan_line base.group_user 1 1 1 1
5 access_yuthon_duty_setting yuthon.duty.setting model_yuthon_duty_setting base.group_user 1 1 1 1
6 access_yuthon_duty_class_setting yuthon.duty.class.setting model_yuthon_duty_class_setting base.group_user 1 1 1 1
7 access_yuthon_duty_summary yuthon.duty.summary model_yuthon_duty_summary base.group_user 1 1 1 1
access_yuthon_duty_summary_wizard yuthon.duty.summary.wizard model_yuthon_duty_summary_wizard base.group_user 1 1 1 1
access_duty_approval_line duty.approval.line model_duty_approval_line base.group_user 1 1 1 1
access_yuthon_adjustments_approval yuthon.adjustments.approval model_yuthon_adjustments_approval base.group_user 1 1 1 1
access_yuthon_abnormal_approval yuthon.abnormal.approval model_yuthon_abnormal_approval base.group_user 1 1 1 1
8 access_yuthon_abnormal_setting access_yuthon_adjustments_approval yuthon.abnormal.setting yuthon.adjustments.approval model_yuthon_abnormal_setting model_yuthon_adjustments_approval base.group_user 1 1 1 1
9 access_yuthon_shift_approval access_yuthon_abnormal_approval yuthon.shift.approval yuthon.abnormal.approval model_yuthon_shift_approval model_yuthon_abnormal_approval base.group_user 1 1 1 1
10 access_yuthon_abnormal_setting yuthon.abnormal.setting model_yuthon_abnormal_setting base.group_user 1 1 1 1
@@ -5,7 +5,11 @@
<field name="model">yuthon.duty.arrangement</field>
<field name="arch" type="xml">
<tree string="值班安排" decoration-danger="is_abnormal">
<header>
<button name="button_all_duty" string="值班汇总计算" type="object" class="oe_highlight"/>
</header>
<field name="employee_id"/>
<field name="duty_class_id"/>
<field name="start_time"/>
<field name="end_time"/>
<field name="week"/>
@@ -13,8 +17,8 @@
<field name="is_photo_two"/>
<field name="is_photo_three"/>
<field name="is_abnormal"/>
<button name="bottom_adjustment" type="object" string="调休" class="btn btn-primary"/>
<button name="button_abnormal" type="object" string="补卡" class="btn btn-primary"/>
<button name="bottom_adjustment" type="object" string="调休" class="btn btn-primary" invisible="week not in ['six', 'seven']"/>
<button name="button_abnormal" type="object" string="补卡" class="btn btn-primary" invisible="not is_abnormal"/>
</tree>
</field>
</record>
@@ -75,10 +79,25 @@
</search>
</field>
</record>
<record id="view_duty_calendar_event_calendar" model="ir.ui.view">
<field name="name">yuthon.duty.arrangement.calendar</field>
<field name="model">yuthon.duty.arrangement</field>
<field name="priority" eval="2"/>
<field name="arch" type="xml">
<calendar string="值班安排"
date_start="start_time"
date_stop="end_time"
event_open_popup="true"
event_limit="5"
quick_create="false"
quick_create_view_id="%(yuthon_duty_plan.view_yuthon_duty_arrangement_form)d">
</calendar>
</field>
</record>
<record id="view_yuthon_duty_arrangement_action" model="ir.actions.act_window">
<field name="name">值班安排</field>
<field name="res_model">yuthon.duty.arrangement</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">tree,form,calendar,search</field>
<field name="context">{'search_default_current_month': 1}</field>
</record>
<record id="all_duty_write_user" model="ir.actions.server">
@@ -18,7 +18,7 @@
<field name="arch" type="xml">
<form string="值班计划">
<header>
<button name="auto_duty_plan" type="object" string="自动排列" class="oe_highlight"/>
<button name="auto_duty_plan" type="object" string="安排值班" class="oe_highlight"/>
</header>
<sheet>
<div class="oe_title">
@@ -27,14 +27,13 @@
<field name="name" required="1"/>
</h1>
</div>
<group col="3">
<group>
<group>
<field name="notice"/>
</group>
<group>
<field name="start_index_time"/>
</group>
<group>
<field name="end_index_time"/>
</group>
<group>
<field name="is_enable"/>
</group>
</group>
@@ -44,7 +43,11 @@
<tree editable="bottom">
<field name="duty_plan_id" column_invisible="1"/>
<field name="sequence" widget="handle"/>
<field name="employee_id" required="1"/>
<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>
@@ -27,4 +27,33 @@
<field name="res_model">yuthon.duty.setting</field>
<field name="view_mode">tree,form</field>
</record>
<record id="view_yuthon_duty_class_setting_tree" model="ir.ui.view">
<field name="name">yuthon.duty.class.setting.tree</field>
<field name="model">yuthon.duty.class.setting</field>
<field name="arch" type="xml">
<tree string="班组配置" editable="bottom">
<field name="name"/>
</tree>
</field>
</record>
<record id="view_yuthon_duty_class_setting_form" model="ir.ui.view">
<field name="name">yuthon.duty.class.setting.form</field>
<field name="model">yuthon.duty.class.setting</field>
<field name="arch" type="xml">
<form string="班组配置">
<sheet>
<group>
<field name="name"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="action_yuthon_duty_class_setting" model="ir.actions.act_window">
<field name="name">值班说明</field>
<field name="res_model">yuthon.duty.class.setting</field>
<field name="view_mode">tree,form</field>
</record>
</odoo>
-2
View File
@@ -1,2 +0,0 @@
from . import yuthon_duty_arrangement_wizard
from . import yuthon_duty_summary_wizard
@@ -1,57 +0,0 @@
from odoo import api, fields, models, tools
from odoo.exceptions import ValidationError, UserError
from datetime import date, timedelta
import random
class YuthonDutyArrangementWizard(models.TransientModel):
_name = 'yuthon.duty.arrangement.wizard'
_description = '自动安排值班弹窗'
number_personnel = fields.Integer(string='人数', help="多少人一循环")
remake = fields.Text(string='备注', default='一次只能排当月的,注意会清空当月数据随机生成。')
def confirm(self):
num_people = self.number_personnel
duty_id = self.env['yuthon.duty.plan'].search([('is_enable', '=', True)])
existing_lines = self.env['duty.plan.line'].search([('duty_plan_id', '=', duty_id.id)])
available_people = existing_lines.mapped('employee_id.id')
if len(available_people) < num_people:
raise UserError("现有值班计划的员工数量不足以满足需求!")
selected_people = random.sample(available_people, num_people)
today = date.today()
first_day_of_month = today.replace(day=1)
last_day_of_month = (today.replace(day=1) + timedelta(days=32)).replace(day=1) - timedelta(days=1)
self.env['yuthon.duty.arrangement'].search([
('start_time', '>=', first_day_of_month),
('start_time', '<=', last_day_of_month),
]).unlink()
today = date.today()
next_month = (today.replace(day=1) + timedelta(days=32)).replace(day=1)
current_date = today
while current_date < next_month:
for employee in selected_people:
self.env['yuthon.duty.arrangement'].create({
'employee_id': employee,
'start_time': current_date,
'end_time': current_date + timedelta(days=1), # 值班一天
})
current_date += timedelta(days=1)
tree_id = self.env.ref("yuthon_duty_plan.view_yuthon_duty_arrangement_tree").id
return {
"type": "ir.actions.act_window",
"name": "值班安排",
"res_model": "yuthon.duty.arrangement",
"views": [[tree_id, "tree"]],
}
@api.model
def action_hr_employee(self):
return {
'type': 'ir.actions.act_window',
'name': '自动安排值班',
'res_model': self._name,
'view_mode': 'form',
'target': 'new',
}
@@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id='yuthon_duty_arrangement_wizard_form' model='ir.ui.view'>
<field name="name">yuthon.duty.arrangement.wizard.form</field>
<field name="model">yuthon.duty.arrangement.wizard</field>
<field name="arch" type="xml">
<form>
<group>
<field name="number_personnel"/>
<field name="remake"/>
</group>
<footer>
<button name="confirm" string="确认" type="object" class="oe_highlight"/>
<button string="返回" class="btn-secondary" special="cancel"/>
</footer>
</form>
</field>
</record>
<record id="yuthon_duty_arrangement_wizard_action" model="ir.actions.server">
<field name="name">自动安排</field>
<field name="model_id" ref="yuthon_duty_plan.model_yuthon_duty_arrangement_wizard"/>
<field name="state">code</field>
<field name="code">action = model.action_hr_employee()
</field>
</record>
</odoo>
@@ -1,37 +0,0 @@
from dateutil.relativedelta import relativedelta
from odoo import api, fields, models, tools, _
from datetime import date, timedelta, datetime
class YuthonDutySummaryWizard(models.TransientModel):
_name = 'yuthon.duty.summary.wizard'
_description = '值班汇总计算'
select_the_month = fields.Selection([('one', '一月'), ('two', '二月'), ('three', '三月'),
('four', '四月'), ('five', '五月'), ('six', '六月'),
('seven', '七月'), ('eight', '八月'), ('nine', '九月'), ('ten', '十月'),
('eleven', '十一月'), ('twelve', '十二月')], string='选择月份', default=lambda self: self._get_current_month())
@api.model
def _get_current_month(self):
current_month = datetime.now().month
month_mapping = {
1: 'one', 2: 'two', 3: 'three', 4: 'four', 5: 'five',
6: 'six', 7: 'seven', 8: 'eight', 9: 'nine', 10: 'ten',
11: 'eleven', 12: 'twelve'
}
return month_mapping.get(current_month, 'one')
@api.model
def action_duty_summary_wizard(self):
return {
'type': 'ir.actions.act_window',
'name': '值班总汇计算',
'res_model': self._name,
'view_mode': 'form',
'target': 'new',
}
def confirm(self):
pass
@@ -1,25 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id='yuthon_duty_summary_wizard_form' model='ir.ui.view'>
<field name="name">yuthon.duty.summary.wizard.form</field>
<field name="model">yuthon.duty.summary.wizard</field>
<field name="arch" type="xml">
<form>
<group>
<field name="select_the_month"/>
</group>
<footer>
<button name="confirm" string="确认" type="object" class="oe_highlight"/>
<button string="返回" class="btn-secondary" special="cancel"/>
</footer>
</form>
</field>
</record>
<record id="yuthon_duty_summary_wizard_action" model="ir.actions.server">
<field name="name">值班汇总计算</field>
<field name="model_id" ref="yuthon_duty_plan.model_yuthon_duty_summary_wizard"/>
<field name="state">code</field>
<field name="code">action = model.action_duty_summary_wizard()
</field>
</record>
</odoo>
@@ -8,11 +8,8 @@ class AttendanceBannerRoute(Controller):
@route('/attendance/banner/route', type='json', auth='user')
def employee_banner_route(self):
current_date = datetime.today()
# 获取当前月份的开始和结束时间
month_start = current_date.replace(day=1, hour=0, minute=0, second=0, microsecond=0)
month_end = (current_date.replace(day=1, hour=0, minute=0, second=0, microsecond=0) + relativedelta(
months=1)) - timedelta(seconds=1)
# 查询当前用户本月的考勤记录
month_end = (current_date.replace(day=1, hour=0, minute=0, second=0, microsecond=0) + relativedelta(months=1)) - timedelta(seconds=1)
domain = [
('employee_id.user_id', '=', request.env.user.id),
('check_in', '>=', month_start),
+1 -1
View File
@@ -77,7 +77,7 @@ class GoApprovalsLine(models.Model):
users_id = fields.Many2one('res.users', string="外出人")
applicants_unit = fields.Selection([('hour', '小时'), ('day', '天')], string="申请单位")
documents_ids = fields.Many2many('ir.attachment', string="附件")
date_start = fields.Datetime(string="开始时间", date_start = fields.Datetime(string="开始时间", default=lambda self: datetime.now().replace(hour=8, minute=30, second=0, microsecond=0)))
date_start = fields.Datetime(string="开始时间", date_start=fields.Datetime(string="开始时间", default=lambda self: datetime.now().replace(hour=8, minute=30, second=0, microsecond=0)))
date_end = fields.Datetime(string="结束时间")
@api.onchange('date_start', 'date_end')
+2 -2
View File
@@ -143,11 +143,11 @@ class HrAttendance(models.Model):
}
def button_duty_approval(self):
form_id = self.env.ref('yuthon_hr_attendance.duty_approval_form').id
form_id = self.env.ref('yuthon_hr_attendance.go_approval_form').id
return {
"type": "ir.actions.act_window",
"name": "外出申请",
"res_model": "duty.approval",
"res_model": "go.approval",
"views": [[form_id, "form"]],
"context": {
'default_users_id': self.employee_id.user_id.id,
@@ -18,4 +18,5 @@ access_yuthon_yuthon_overall_planning,yuthon.overall.planning,model_yuthon_overa
access_yuthon_engineering_overall_planning,engineering.overall.planning,model_yuthon_engineering_overall_planning,base.group_user,1,1,1,1
access_yuthon_run_planning,yuthon.run.planning,model_yuthon_run_planning,base.group_user,1,1,1,1
access_yuthon_engineering_run_line,engineering.run.line,model_yuthon_engineering_run_line,base.group_user,1,1,1,1
access_duty_approval,duty.approval,model_duty_approval,base.group_user,1,1,1,1
access_duty_approval,duty.approval,model_duty_approval,base.group_user,1,1,1,1
access_duty_approval_line,duty.approval.line,model_duty_approval_line,base.group_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
18 access_yuthon_engineering_overall_planning engineering.overall.planning model_yuthon_engineering_overall_planning base.group_user 1 1 1 1
19 access_yuthon_run_planning yuthon.run.planning model_yuthon_run_planning base.group_user 1 1 1 1
20 access_yuthon_engineering_run_line engineering.run.line model_yuthon_engineering_run_line base.group_user 1 1 1 1
21 access_duty_approval duty.approval model_duty_approval base.group_user 1 1 1 1
22 access_duty_approval_line duty.approval.line model_duty_approval_line base.group_user 1 1 1 1
@@ -1,9 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<menuitem id="menu_hr_attendance_manager" name="经理" parent="hr_attendance.menu_hr_attendance_root" sequence="12"/>
<menuitem id="menu_hr_attendance_manager_going" name="出勤" parent="menu_hr_attendance_manager" sequence="1"
action="view_attendance_going_action"/>
<!-- !!!!! -->
<menuitem id="menu_hr_attendance_approval_request" name="考勤审批记录"
parent="hr_attendance.menu_hr_attendance_root" sequence="13"/>
<menuitem id="menu_hr_attendance_overtime" name="加班申请"
@@ -1,37 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Views -->
<record id="view_attendance_going_tree" model="ir.ui.view">
<field name="name">hr.attendance.going.tree</field>
<field name="model">hr.attendance</field>
<field name="arch" type="xml">
<tree string="出勤" editable="bottom"
decoration-danger="is_abnormal">
<field name="employee_id" widget="many2one_avatar_user"/>
<!-- <field name="company_id" optional="show"/>-->
<!-- <field name="current_data" optional="show"/>-->
<field name="is_clock_card" optional="show" class="list_width"/>
<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="work_time_type" optional="hidden"/>
<field name="check_in" optional="show" widget="time"/>
<!-- <field name="on_card_location" optional="show"/>-->
<field name="check_out" optional="show" widget="time"/>
<button name="button_leave" type="object" string="请假" class="oe_highlight"/>
<button name="button_compensatory_leave" type="object" string="调休" class="oe_highlight"/>
<button name="button_abnormal_approval" type="object" string="异常提醒" class="oe_highlight"
column_invisible="not is_abnormal"/>
<button name="button_card_approval" type="object" string="补卡" class="oe_highlight"
column_invisible="not is_no_card"/>
</tree>
</field>
</record>
<record id="view_attendance_going_tree2" model="ir.ui.view">
<field name="name">hr.attendance.going.tree</field>
<field name="name">hr.attendance.going.tree2</field>
<field name="model">hr.attendance</field>
<field name="arch" type="xml">
<tree string="出勤" editable="bottom" decoration-danger="is_abnormal"
@@ -47,76 +17,26 @@
<field name="work_time_type" optional="hidden"/>
<field name="check_in" optional="show" widget="time"/>
<field name="check_out" optional="show" widget="time"/>
<button name="button_leave" type="object" string="请假" class="oe_highlight"/>
<button name="button_compensatory_leave" type="object" string="调休" class="oe_highlight"/>
<button name="button_abnormal_approval" type="object" string="异常提醒" class="oe_highlight"
column_invisible="not is_abnormal"/>
<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"
column_invisible="not is_abnormal"/>
invisible="not is_abnormal"/>
<button name="button_duty_approval" type="object" string="外出" class="oe_highlight"
column_invisible="not is_abnormal"/>
invisible="not is_abnormal"/>
</tree>
</field>
</record>
<record id='hr_attendance_search_my' model='ir.ui.view'>
<field name='name'>hr.attendance.search.my</field>
<field name='model'>hr.attendance</field>
<field name='arch' type='xml'>
<search string='考勤'>
<group string="月份">
<filter string="月份" name="current_data" context="{'group_by': 'current_data'}"/>
</group>
</search>
</field>
</record>
<!-- Actions -->
<record id="view_attendance_going_action" model="ir.actions.act_window">
<field name="name">出勤</field>
<field name="res_model">hr.attendance</field>
<field name="view_mode">tree,form</field>
</record>
<record id="action_attendance_yuthon_company_form1" 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.yuthon_company','=','thtz')]</field>
</record>
<record id="action_attendance_yuthon_company_form2" 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.yuthon_company', '=', 'thlc')]</field>
</record>
<record id="action_attendance_yuthon_company_form3" 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.yuthon_company', '=', 'thwg')]</field>
</record>
<record id="hr_attendance_action1" 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.user_id', '=', uid), ('week', 'not in', ['seven', 'six'])]</field>
<field name="context">
{ "search_default_current_data": 1 }
</field>
<field name="search_view_id" ref="hr_attendance_search_my"/>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_hr_attendance.view_attendance_going_tree2')})]"/>
</record>
@@ -124,12 +44,33 @@
<field name="name">我的异常</field>
<field name="res_model">hr.attendance</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('employee_id.user_id', '=', uid), ('abnormal', '=', 1), ('week', 'not in', ['seven', 'six'])]</field>
<field name="context">{ "search_default_current_data": 1 }</field>
<field name="search_view_id" ref="hr_attendance_search_my"/>
<field name="domain">[('employee_id.user_id', '=', uid), ('abnormal', '=', 1), ('week', 'not in', ['seven',
'six'])]
</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_hr_attendance.view_attendance_going_tree2')})]"/>
</record>
<record id="action_attendance_yuthon_company_form1" 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.yuthon_company','=','thtz')]</field>
</record>
<record id="action_attendance_yuthon_company_form2" 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.yuthon_company', '=', 'thlc')]</field>
</record>
<record id="action_attendance_yuthon_company_form3" 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.yuthon_company', '=', 'thwg')]</field>
</record>
<record id="hr_attendance_action2" model="ir.actions.act_window">
<field name="name">全部考勤</field>
<field name="res_model">hr.attendance</field>
+28 -33
View File
@@ -15,10 +15,10 @@
parent="hr_attendance_root_board"
action="yuthon_hr_attendance.hr_attendance_action_is_abnormal"
sequence="2"/>
<!-- <menuitem id="menu_hr_plan_arrange_board"-->
<!-- name="计划总览"-->
<!-- parent="menu_hr_attendance_plan_request_board"-->
<!-- sequence="1"/>-->
<!-- <menuitem id="menu_hr_plan_arrange_board"-->
<!-- name="计划总览"-->
<!-- parent="menu_hr_attendance_plan_request_board"-->
<!-- sequence="1"/>-->
<menuitem id="menu_hr_attendance_security_record_board"
name="保安部计划"
parent="hr_attendance_root_board"
@@ -142,7 +142,7 @@
name="综合班"
parent="menu_hr_attendance_engineering_record_board"
sequence="5"/>
<menuitem id="menu_hr_plan_sources_board4"
<menuitem id="menu_hr_plan_sources_board4"
name="排班计划"
parent="menu_hr_attendance_engineering_integrated_board"
action="yuthon_hr_attendance.action_planning_slot_form4"
@@ -176,21 +176,21 @@
parent="menu_hr_attendance_planning_setting3"
action="yuthon_hr_attendance.action_planning_slot_template_form4"
sequence="3"/>
<!-- <menuitem id="menu_hr_plan_employee_board"-->
<!-- name="按角色分类"-->
<!-- parent="menu_hr_plan_arrange_board"-->
<!-- action="planning.planning_action_schedule_by_role"-->
<!-- sequence="3"/>-->
<!-- <menuitem id="menu_hr_my_plan_board"-->
<!-- name="我的计划"-->
<!-- parent="menu_hr_attendance_plan_request_board"-->
<!-- action="planning.planning_action_my_calendar"-->
<!-- sequence="3"/>-->
<!-- <menuitem id="menu_hr_plan_approval_board"-->
<!-- name="计划分析"-->
<!-- parent="menu_hr_attendance_plan_request_board"-->
<!-- action="planning.planning_report_action_analysis"-->
<!-- sequence="5"/>-->
<!-- <menuitem id="menu_hr_plan_employee_board"-->
<!-- name="按角色分类"-->
<!-- parent="menu_hr_plan_arrange_board"-->
<!-- action="planning.planning_action_schedule_by_role"-->
<!-- sequence="3"/>-->
<!-- <menuitem id="menu_hr_my_plan_board"-->
<!-- name="我的计划"-->
<!-- parent="menu_hr_attendance_plan_request_board"-->
<!-- action="planning.planning_action_my_calendar"-->
<!-- sequence="3"/>-->
<!-- <menuitem id="menu_hr_plan_approval_board"-->
<!-- name="计划分析"-->
<!-- parent="menu_hr_attendance_plan_request_board"-->
<!-- action="planning.planning_report_action_analysis"-->
<!-- sequence="5"/>-->
<menuitem id="hr_attendance_record_root_board"
name="考勤记录"
parent="hr_attendance_root_board"
@@ -198,7 +198,7 @@
<menuitem id="menu_hr_attendance_all_record_board"
name="全部考勤"
parent="hr_attendance_record_root_board"
action="hr_attendance.hr_attendance_action"
action="hr_attendance.hr_attendance_action"
sequence="1"/>
<menuitem id="menu_hr_attendance_tt_record_board"
name="天河投资"
@@ -226,26 +226,16 @@
parent="menu_hr_attendance_duty_summary_menu_board"
action="yuthon_duty_plan.view_yuthon_duty_plan_action"
sequence="1"/>
<menuitem id="menu_hr_attendance_duty_automatically_scheduled"
name="自动排班"
parent="menu_hr_attendance_duty_summary_menu_board"
action="yuthon_duty_plan.yuthon_duty_arrangement_wizard_action"
sequence="3"/>
<menuitem id="menu_hr_attendance_duty_summary_board"
name="值班安排"
parent="menu_hr_attendance_duty_summary_menu_board"
action="yuthon_duty_plan.view_yuthon_duty_arrangement_action"
sequence="5"/>
sequence="3"/>
<menuitem id="menu_hr_attendance_summary_root_board"
name="值班汇总"
parent="menu_hr_attendance_duty_summary_menu_board"
action="yuthon_duty_plan.view_yuthon_duty_summary_action"
sequence="7"/>
<menuitem id="menu_hr_attendance_duty_summary_compute_board"
name="值班汇总计算"
parent="menu_hr_attendance_duty_summary_menu_board"
action="yuthon_duty_plan.yuthon_duty_summary_wizard_action"
sequence="9"/>
sequence="5"/>
<menuitem id="menu_hr_attendance_duty_summary_flow_board"
name="流程"
parent="menu_hr_attendance_duty_summary_menu_board"
@@ -274,6 +264,11 @@
parent="menu_yuthon_duty_summary_setting"
sequence="1"
action="yuthon_duty_plan.action_yuthon_duty_setting"/>
<menuitem id="menu_yuthon_duty_shows_class_board"
name="班组配置"
parent="menu_yuthon_duty_summary_setting"
sequence="2"
action="yuthon_duty_plan.action_yuthon_duty_class_setting"/>
<menuitem id="menu_yuthon_abnormal_setting_board"
name="值班补卡次数"
parent="menu_yuthon_duty_summary_setting"