This commit is contained in:
李鹏宇
2025-04-02 15:45:18 +08:00
parent 17790442e9
commit cca67f7ea9
142 changed files with 71 additions and 622 deletions
-1
View File
@@ -14,7 +14,6 @@
'data/ir_module_category_data.xml',
'data/room_meeting_type_data.xml',
'security/ir_rule.xml',
'security/room_company_security_group.xml',
'security/ir.model.access.csv',
'views/room_booking_views.xml',
'views/room_room_views.xml',
-2
View File
@@ -34,8 +34,6 @@ class RoomBooking(models.Model):
is_day = fields.Boolean(string="提前一天", default=True)
meeting_type = fields.Selection([('up', '线上'), ('down', '线下'), ('exterior', '外部')], default='down', string="会议形式",
required=True)
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'), ('thlc', '天河粮储')],
string='所属公司')
meeting_type_id = fields.Many2one('room.meeting.type', string="会议类型")
room_users_ids = fields.Many2many('res.users', string="参会人员", store=True)
other_company_id = fields.Many2one('res.partner', string="外部公司")
-2
View File
@@ -28,8 +28,6 @@ class Room(models.Model):
# Technical/Statistics
access_token = fields.Char("Access Token", default=lambda self: str(uuid4()), copy=False, readonly=True, required=True)
bookings_count = fields.Integer("Bookings Count", compute="_compute_bookings_count")
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'), ('thlc', '天河粮储')],
string='公司')
is_available = fields.Boolean(string="Is Room Currently Available", compute="_compute_is_available")
next_booking_start = fields.Datetime("Next Booking Start", compute="_compute_next_booking_start")
room_booking_url = fields.Char("Room Booking URL", compute="_compute_room_booking_url")
@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="inherit_room_booking_views_rule" model="ir.rule">
<field name="name">预定房间公司过滤</field>
<field name="model_id" ref="model_room_booking"/>
<field name="domain_force">[('yuthon_company', '=', user.employee_id.yuthon_company)]</field>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_create" eval="True"/>
<field name="perm_unlink" eval="True"/>
</record>
<record id="inherit_room_room_views_rule" model="ir.rule">
<field name="name">房间公司过滤</field>
<field name="model_id" ref="model_room_room"/>
<field name="domain_force">[('yuthon_company', '=', user.employee_id.yuthon_company)]</field>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_create" eval="True"/>
<field name="perm_unlink" eval="True"/>
</record>
</odoo>
-1
View File
@@ -153,7 +153,6 @@
</group>
<group>
<field name="department_id"/>
<field name="yuthon_company"/>
<field name="meeting_type_id" required="1"/>
</group>
</group>
-6
View File
@@ -13,9 +13,6 @@
<filter name="is_meet_video" string="视频" domain="[('is_meet_video', '=', True)]"/>
<filter name="meet_capacity" string="二十人以上" domain="[('meet_capacity', '&gt;', 20)]"/>
<filter name="meet_capacity" string="二十人以下" domain="[('meet_capacity', '&lt;', 20)]"/>
<group expand="0" string="group_by">
<filter name="group_yuthon_company" string="公司" context="{'group_by':'yuthon_company'}"/>
</group>
</search>
</field>
@@ -57,7 +54,6 @@
</div>
<div>
<span>公司:</span>
<field name="yuthon_company"/>
</div>
</div>
</div>
@@ -122,7 +118,6 @@
<field name="meet_document_id"/>
<field name="office_address"/>
<field name="department_id"/>
<field name="yuthon_company"/>
<field name="short_code" invisible="1"/>
</group>
<!-- <group>-->
@@ -172,7 +167,6 @@
<field name="name">会议室</field>
<field name="res_model">room.room</field>
<field name="view_mode">kanban,list,form</field>
<field name="context">{'search_default_group_yuthon_company': 1 }</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create Rooms
-23
View File
@@ -22,8 +22,6 @@ class YuthonUserRole(models.Model):
personnel = fields.Text(string="在岗人员", store=True)
employee_ids = fields.One2many('hr.employee', 'user_role_id')
child_ids = fields.One2many('soong.user.role', 'parent_id', string='下级角色', index=True)
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'),
('thlc', '天河粮储'), ('thtjbb', '天河投资本部')], string="所属公司", compute='compute_company')
pinyin_name = fields.Char(string="拼音名称", compute='_compute_pinyin', index=True, store=True)
def write(self, vals):
@@ -40,27 +38,6 @@ class YuthonUserRole(models.Model):
if record.department_id and record.name:
record.display_name = record.department_id.name + ' - ' + record.name
@api.depends('department_id')
def compute_company(self):
company_mapping = {'集团本部': 'thtz',
'天河物管': 'thwg',
'天河粮储': 'thlc',
'天河投资本部': 'thtjbb'}
for record in self:
visited_departments = set()
department = record.department_id
while department and department.id not in visited_departments:
visited_departments.add(department.id)
if department.name == '集团本部':
record.yuthon_company = 'thtz'
break
elif department.name in company_mapping:
record.yuthon_company = company_mapping[department.name]
break
department = department.parent_id
else:
record.yuthon_company = 'thtz'
@api.depends('name')
def _compute_pinyin(self):
for employee in self:
@@ -128,7 +128,7 @@ class SoongWorkflowMixin(models.AbstractModel):
employee_ids = record.sudo().env['hr.employee'].search(
['|', ('user_role_id', '=', button_id.users_role_id.id), ('user_role_ids', 'in', button_id.users_role_id.id),
'|', ('department_id', '=', record.env.user.employee_id.department_id.id), ('department_ids', 'in', record.env.user.employee_id.department_id.id),
('yuthon_company', '=', record.env.user.employee_id.yuthon_company)])
])
if record.env.user.employee_id.id in employee_ids.ids:
record.state = button_id.node_id.node_name
return res
@@ -29,7 +29,6 @@
<field name="pinyin_name" column_invisible="1"/>
<field name="parent_id"/>
<field name="child_ids" column_invisible="1"/>
<field name="yuthon_company" readonly="0"/>
<field name="create_time" optional="hide"/>
<field name="end_time" optional="hide"/>
</tree>
@@ -60,7 +59,6 @@
<field name="personnel_ids" readonly='False' widget="many2many_tags"/>
<field name="number_people"/>
<field name="child_ids" widget="many2many_tags"/>
<field name="yuthon_company"/>
</group>
</group>
</sheet>
@@ -81,20 +81,16 @@ class SoongWorkflowCommentWizard(models.TransientModel):
next_is_automatic = workflow_id.node_ids.search([('name', '=', self.trans_link_id.name), ('workflow_id', '=', workflow_id.id)]).button_ids[0].is_automatic
# 不自动匹配
employee_user_role_ids = self.env['hr.employee'].search(['|', ('user_role_id', '=', link_users_id.id),
('user_role_ids', 'in', link_users_id.id),
('yuthon_company', '=',
record_id.create_uid.employee_id.yuthon_company)])
('user_role_ids', 'in', link_users_id.id)])
# 自动匹配
employee_user_role_id = self.env['hr.employee'].search(['|', ('user_role_id', '=', link_users_id.id), ('user_role_ids', 'in', link_users_id.id),
'|', ('department_id', '=', record_id.department_id.id),
('department_ids', 'in', record_id.department_id.id),
('yuthon_company', '=', record_id.create_uid.employee_id.yuthon_company)])
('department_ids', 'in', record_id.department_id.id)])
if not employee_user_role_id:
employee_user_role_id = self.env['hr.employee'].search(
['|', ('user_role_id', '=', link_users_id.id), ('user_role_ids', 'in', link_users_id.id),
'|', ('department_id', '=', record_id.department_id.parent_id.id),
('department_ids', 'in', record_id.department_id.parent_id.id),
('yuthon_company', '=', record_id.create_uid.employee_id.yuthon_company)])
('department_ids', 'in', record_id.department_id.parent_id.id)])
self.employee_trans_domain_ids = employee_user_role_ids if not next_is_automatic else employee_user_role_id
self.employee_ids = employee_user_role_ids if not next_is_automatic else employee_user_role_id
if '分发' in ret.name:
@@ -13,8 +13,7 @@ class HrContract(models.Model):
resource_calendar_id = fields.Many2one('resource.calendar', string='考勤时间表')
date_of_entry = fields.Date(related='employee_id.entry_date', string="入职时间")
salary_group_id = fields.Many2one(related='employee_id.salary_group_id', string="工资单分组", store=True, index=True)
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'), ('thlc', '天河粮储')],
related='employee_id.yuthon_company', string="所属公司", readonly=False)
work_entry_source = fields.Selection([
('calendar', '考勤安排'),
('attendance', 'Attendances'),
@@ -16,6 +16,7 @@
</xpath>
</field>
</record>
<record id="inherit_hr_contract_yuthon_form" model="ir.ui.view">
<field name="name">inherit.hr.contract.yuthon.form</field>
<field name="model">hr.contract</field>
@@ -27,12 +28,6 @@
<xpath expr="//page[@name='other']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='job_id']" position="attributes">
<attribute name="domain">[('yuthon_company', '=', yuthon_company)]</attribute>
</xpath>
<xpath expr="//field[@name='department_id']" position="before">
<field name="yuthon_company"/>
</xpath>
<xpath expr="//field[@name='contract_type_id']" position="after">
<field name="is_probation"/>
<field name="salary_group_id"/>
@@ -78,16 +73,7 @@
</xpath>
</field>
</record>
<record id="hr_contract_view_form_inherit_work_entry_attendance1" model="ir.ui.view">
<field name="name">hr.contract.view.form.inherit.work.entry.attendance1</field>
<field name="model">hr.contract</field>
<field name="inherit_id" ref="hr_contract.hr_contract_view_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='work_entry_source']" position="after">
<field name="documents_ids" widget="preview_many2many"/>
</xpath>
</field>
</record>
<record id="all_data_write_user_contract" model="ir.actions.server">
<field name="name">批量导入合同</field>
<field name="model_id" ref="hr_contract.model_hr_contract"/>
+15 -16
View File
@@ -250,7 +250,6 @@ class HolidaysRequestBatch(models.Model):
name = fields.Char(string='标题')
employee_id = fields.Many2one(string='员工', comodel_name='hr.employee', required=True, default=_get_default_emp,
index=True)
yuthon_company = fields.Selection(related='employee_id.yuthon_company', string="公司")
users_id = fields.Many2one('res.users', string="请假人", default=lambda self: self.env.user.id)
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
user_role_id = fields.Many2one(related='users_id.employee_id.user_role_id', string="角色")
@@ -300,21 +299,21 @@ class HolidaysRequestBatch(models.Model):
self.leave_ids.action_validate()
self.hour_leave_ids.action_validate()
@api.model_create_multi
def create(self, vals_list):
for vals in vals_list:
number_hours = 0
if vals.get('yuthon_company') == 'thwg':
if 'hour_leave_ids' in vals:
for leave_info in vals.get('hour_leave_ids', []):
hours_text = leave_info[2]['number_of_hours_text']
match = re.search(r'\d+', hours_text)
if match:
number_hours += float(match.group())
valid_hours = [2, 4, 6, 8]
if number_hours not in valid_hours:
raise ValidationError("休假时长必须为 2、4、6 或 8 小时才可以保存!")
return super(HolidaysRequestBatch, self).create(vals_list)
# @api.model_create_multi
# def create(self, vals_list):
# for vals in vals_list:
# number_hours = 0
# if vals.get('yuthon_company') == 'thwg':
# if 'hour_leave_ids' in vals:
# for leave_info in vals.get('hour_leave_ids', []):
# hours_text = leave_info[2]['number_of_hours_text']
# match = re.search(r'\d+', hours_text)
# if match:
# number_hours += float(match.group())
# valid_hours = [2, 4, 6, 8]
# if number_hours not in valid_hours:
# raise ValidationError("休假时长必须为 2、4、6 或 8 小时才可以保存!")
# return super(HolidaysRequestBatch, self).create(vals_list)
@api.onchange('leave_ids', 'hour_leave_ids', 'employee_id')
def _onchange_leave_dates(self):
@@ -7,7 +7,6 @@ class YuthonFixesApproval(models.Model):
_description = '假期修正审批'
_inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin']
yuthon_company = fields.Selection(related='users_id.employee_id.yuthon_company', string="公司")
name = fields.Char(string="标题")
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_holiday_fixes_code'))
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
@@ -9,6 +9,5 @@ class YuthonHolidaySetting(models.Model):
_description = '请假流程说明'
name = fields.Text(string='名称')
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'), ('thlc', '天河粮储')], string='所属公司')
department_ids = fields.Many2many('hr.department', string="部门")
-1
View File
@@ -55,7 +55,6 @@
<field name="is_hour"/>
<field name="is_day"/>
<field name="holiday_allowance"/>
<field name="yuthon_company" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="user_role_id" invisible="1"/>
<field name="is_issues" invisible="1"/>
@@ -7,7 +7,6 @@
<tree string="假期修正审批">
<field name="name"/>
<field name="users_id"/>
<field name="yuthon_company"/>
<field name="department_id"/>
</tree>
</field>
@@ -63,7 +62,6 @@
</group>
<group>
<field name="remarks" invisible="1"/>
<field name="yuthon_company" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="now_type" invisible="1"/>
<field name="leave_id" invisible="1"/>
@@ -6,8 +6,7 @@
<field name="arch" type="xml">
<tree string="假期流程配置" editable="bottom">
<field name="name"/>
<field name="yuthon_company"/>
<field name="department_ids" widget="many2many_tags" domain="[('yuthon_company', '=' ,yuthon_company)]"/>
<field name="department_ids" widget="many2many_tags"/>
</tree>
</field>
</record>
-1
View File
@@ -16,7 +16,6 @@
'soong_workflow', 'yuthon_issue', 'planning', 'calendar', 'web_gantt', 'yuthon_wechat', 'yuthon_hr_employee'],
'data': [
'security/ir.model.access.csv',
'security/attendance_group.xml',
'security/planning_group.xml',
'data/hr_attendance_time.xml',
'data/attendance_code_data.xml',
@@ -12,7 +12,6 @@ class CardApprovals(models.Model):
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin', 'soong.workflow.mixin']
_rec_name = 'name'
yuthon_company = fields.Selection(related='users_id.employee_id.yuthon_company', string="公司")
name = fields.Char(string="标题", compute='_compute_name')
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('overtime_approval'))
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
@@ -10,7 +10,6 @@ class DutyApprovals(models.Model):
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin', 'soong.workflow.mixin']
_rec_name = 'name'
yuthon_company = fields.Selection(related='users_id.employee_id.yuthon_company', string="公司")
name = fields.Char(string="标题", compute='_compute_name')
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('overtime_approval'))
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
@@ -15,7 +15,6 @@ class GoApprovals(models.Model):
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin', 'soong.workflow.mixin']
_rec_name = 'name'
yuthon_company = fields.Selection(related='users_id.employee_id.yuthon_company', string="公司")
name = fields.Char(string="标题", compute='_compute_name', store=True, readonly=False)
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('overtime_approval'))
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
@@ -22,7 +22,6 @@ class HrAttendance(models.Model):
absenteeism_card = fields.Boolean(string="旷工", group_operator='count_true')
work_time_type = fields.Selection([('close_day', '休息日'), ('work_day', '工作日')], string="工作时间类型")
company_id = fields.Many2one('res.company', string='公司', index=True, default=lambda self: self.env.company)
yuthon_company = fields.Selection(related='employee_id.yuthon_company', string="公司")
on_card_location = fields.Char(string="上班打卡地点")
down_card_location = fields.Char(string="下班打卡地点")
out_card_time = fields.Datetime(string="外出打卡时间")
@@ -43,7 +43,6 @@ class HrAttendanceMonth(models.Model):
is_statistics = fields.Boolean(string="是否已统计", store=True, default=False)
statistics_time = fields.Datetime(string="统计时间")
attendance_month_detail_ids = fields.One2many(string="出勤月度汇总明细", comodel_name='hr.attendance.month.detail', inverse_name='hr_attendance_month_id')
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'), ('thlc', '天河粮储')],string='公司')
def _compute_name(self):
for record in self:
@@ -130,8 +129,6 @@ class HrAttendanceMonthDetail(models.Model):
note = fields.Char(string='备注')
hr_attendance_month_id = fields.Many2one('hr.attendance.month', string="出勤月度汇总", ondelete="cascade", readonly=True)
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'), ('thlc', '天河粮储')],
string='公司')
signature = fields.Image(string="签名", copy=False, attachment=True, max_width=1024, max_height=1024)
signed_by = fields.Char(string="签名者", copy=False)
signed_on = fields.Datetime(string="签名时间", copy=False)
@@ -602,11 +599,9 @@ class HrAttendanceMonthDetail(models.Model):
:return: obj
"""
self.ensure_one()
yuthon_company = self.yuthon_company
attendance_month_obj = self.env["hr.attendance.month"].search([
('current_year', '=', self.current_year),
('current_month', '=', self.current_month),
('yuthon_company', '=', yuthon_company),
('current_month', '=', self.current_month)
], limit=1)
if not attendance_month_obj:
attendance_month_obj = self.env["hr.attendance.month"].sudo().create({
@@ -615,7 +610,6 @@ class HrAttendanceMonthDetail(models.Model):
"current_month": self.current_month,
"is_statistics": True,
"statistics_time": fields.Datetime.now(),
"yuthon_company": yuthon_company,
})
return attendance_month_obj
@@ -626,12 +620,10 @@ class HrAttendanceMonthDetail(models.Model):
:return: 考情明细
"""
self.ensure_one()
yuthon_company = self.yuthon_company
attendance_month_detail_obj = self.env["hr.attendance.month.detail"].search(
[('employee_id', '=', employee.id),
('current_year', '=', self.current_year),
('current_month', '=', self.current_month),
('yuthon_company', '=', yuthon_company)
], limit=1)
if not attendance_month_detail_obj:
attendance_month_detail_obj = self.env["hr.attendance.month.detail"].sudo().create({
@@ -639,7 +631,6 @@ class HrAttendanceMonthDetail(models.Model):
"attendance_year_id": self.attendance_year_id.id,
"current_year": self.current_year,
"current_month": self.current_month,
"yuthon_company": yuthon_company
})
return attendance_month_detail_obj
@@ -13,7 +13,6 @@ class OvertimeApprovals(models.Model):
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin', 'soong.workflow.mixin']
_rec_name = 'name'
yuthon_company = fields.Selection(related='users_id.employee_id.yuthon_company', string="公司")
name = fields.Char(string="标题", compute='_compute_name')
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('overtime_approval'))
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
@@ -51,14 +50,14 @@ class OvertimeApprovals(models.Model):
else:
rec.duration = 0.0
@api.model_create_multi
def create(self, vals_list):
for vals in vals_list:
if vals.get('yuthon_company') == 'thwg':
if vals.get('duration'):
if (vals['duration']) % 1 != 0.5:
raise ValidationError("时长不对!请重新编辑")
return super(OvertimeApprovals, self).create(vals_list)
# @api.model_create_multi
# def create(self, vals_list):
# for vals in vals_list:
# if vals.get('yuthon_company') == 'thwg':
# if vals.get('duration'):
# if (vals['duration']) % 1 != 0.5:
# raise ValidationError("时长不对!请重新编辑")
# return super(OvertimeApprovals, self).create(vals_list)
@api.onchange('is_issues')
def _onchange_is_issues(self):
@@ -106,12 +105,12 @@ class OvertimeApprovals(models.Model):
}))
over.overtime_user_ids = users_data_list
@api.onchange('yuthon_company')
def onchange_company(self):
for record in self:
overtime_id = record.env['overtime.page'].search([('yuthon_company', '=', record.yuthon_company)])
record.details = (f"1、每天加班不得超过{overtime_id.day_time}\n"
f"2、每月加班不得超过{overtime_id.month_time}\n")
# @api.onchange('yuthon_company')
# def onchange_company(self):
# for record in self:
# overtime_id = record.env['overtime.page'].search([('yuthon_company', '=', record.yuthon_company)])
# record.details = (f"1、每天加班不得超过{overtime_id.day_time}\n"
# f"2、每月加班不得超过{overtime_id.month_time}\n")
def put_hr_employee(self):
for record in self:
@@ -6,7 +6,6 @@ class OvertimePage(models.Model):
_name = 'overtime.page'
_description = '加班说明配置'
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'), ('thlc', '天河粮储')], string='公司')
department_id = fields.Many2one("hr.department", string="部门")
day_time = fields.Char(string="工作日加班时间不超过")
month_time = fields.Char(string="公休日和节假日不超过")
@@ -9,7 +9,6 @@ class YuthonAbnormalApproval(models.Model):
_description = '值班补卡审批'
_rec_name = 'name'
yuthon_company = fields.Selection(related='users_id.employee_id.yuthon_company', string="公司")
name = fields.Char(string="标题")
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('abnormal_approval'))
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
@@ -9,7 +9,6 @@ class YuthonAdjustmentsApproval(models.Model):
_description = '值班调休审批'
_rec_name = 'name'
yuthon_company = fields.Selection(related='users_id.employee_id.yuthon_company', string="公司")
name = fields.Char(string="标题")
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('adjustments_approval'))
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
@@ -9,7 +9,6 @@ class YuthonCustomerApproval(models.Model):
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin', 'soong.workflow.mixin']
_rec_name = 'name'
yuthon_company = fields.Selection(related='users_id.employee_id.yuthon_company', string="公司")
name = fields.Char(string="标题")
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('overtime_approval'))
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
@@ -8,7 +8,6 @@ class YuthonShiftApproval(models.Model):
_inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin']
_description = '值班调替班审批'
yuthon_company = fields.Selection(related='users_id.employee_id.yuthon_company', string="公司")
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
name = fields.Char(string="标题", default=lambda self: self.env.user.employee_id.resource_id.name)
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('shift_approval'))
@@ -8,7 +8,6 @@ class YuthonSpecialApproval(models.Model):
_inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin']
_description = '特殊加班'
yuthon_company = fields.Selection(related='users_id.employee_id.yuthon_company', string="公司")
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
name = fields.Char(string="标题", readonly=False, default=lambda self: self.env.user.employee_id.resource_id.name)
reason_application = fields.Html(string="申请事由")
@@ -1,36 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="module_he_attendance_th" model="ir.module.category">
<field name="name">出勤组</field>
</record>
<record id="group_he_attendance_leader" model="res.groups">
<field name="name">考勤记录(天河投资)</field>
<field name="category_id" ref="module_he_attendance_th"/>
</record>
<record id="group_he_attendance_leader2" model="res.groups">
<field name="name">考勤记录(天河物管)</field>
<field name="category_id" ref="module_he_attendance_th"/>
</record>
<record id="group_he_attendance_leader3" model="res.groups">
<field name="name">考勤记录(天河粮储)</field>
<field name="category_id" ref="module_he_attendance_th"/>
</record>
<record id="group_he_attendance_manager" model="res.groups">
<field name="name">管理者</field>
<field name="category_id" ref="module_he_attendance_th"/>
<field name="implied_ids" eval="[(4, ref('group_he_attendance_leader')),
(4, ref('group_he_attendance_leader2')), (4, ref('group_he_attendance_leader3'))]"/>
<field name="users" eval="[(4, ref('base.user_admin'))]"/>
</record>
<record id="inherit_hr_attendance_views_rule" model="ir.rule">
<field name="name">考勤记录公司过滤</field>
<field name="model_id" ref="model_hr_attendance"/>
<field name="domain_force">[('yuthon_company', '=', user.employee_id.yuthon_company)]</field>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_create" eval="True"/>
<field name="perm_unlink" eval="True"/>
</record>
</data>
</odoo>
@@ -38,7 +38,7 @@
<menuitem id="menu_hr_attendance_record_board"
name="考勤记录"
parent="hr_attendance_root_board"
action="action_attendance_yuthon_company_form"
action="action_attendance_company_form"
sequence="10"/>
<!-- 计划相关 -->
<menuitem id="menu_hr_attendance_approval_request_board"
@@ -5,7 +5,6 @@
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="yuthon_company" optional="hide"/>
<field name="department_id" optional="hide"/>
<field name="users_id"/>
</tree>
@@ -54,7 +53,6 @@
<field name="validity"/>
<field name="work_end" invisible="1"/>
<field name="issues_result" invisible="is_issues == False"/>
<field name="yuthon_company" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="work_end" invisible="1"/>
</group>
@@ -52,7 +52,6 @@
<group>
<group>
<field name="users_id" invisible="1"/>
<field name="yuthon_company" invisible="1"/>
<field name="days"/>
<field name="hours"/>
<field name="work_end" invisible="1"/>
@@ -25,7 +25,6 @@
<field name="current_month"/>
<field name="is_statistics"/>
<field name="statistics_time"/>
<field name="yuthon_company"/>
<button name="action_show_details" string="汇总明细" type="object" title="Show Details" icon="fa-list"/>
</tree>
</field>
@@ -97,7 +96,6 @@
<!-- 其他-->
<field name="holiday_id"/>
<field name="note"/>
<field name="yuthon_company"/>
<field name="state" widget="badge" decoration-info="state == 'unconfirmed'"
decoration-success="state == 'confirmed'"/>
<button name="button_put" string="发送" type="object" class="oe_highlight"/>
@@ -139,7 +137,6 @@
<!-- 其他-->
<field name="holiday_id" invisible="1"/>
<field name="note"/>
<field name="yuthon_company" invisible="1"/>
<field name="state" widget="badge" decoration-info="state == 'unconfirmed'"
decoration-success="state == 'confirmed'"/>
<button name="button_confirm" string="确认" type="object" class="oe_highlight" invisible="state == 'confirmed'"/>
@@ -192,7 +189,6 @@
<group>
<field name="holiday_id" invisible="1"/>
<field name="note"/>
<field name="yuthon_company" invisible="1"/>
</group>
</group>
</sheet>
@@ -223,7 +219,6 @@
<field name="work_overtime"/>
<field name="statutory_leave"/>
<field name="note"/>
<field name="yuthon_company"/>
<field name="state"/>
</group>
</group>
@@ -24,7 +24,6 @@
<field name="abnormal" optional="show" column_invisible="1"/>
<field name="work_time_type" optional="hidden"/>
<field name="is_approval" optional="hidden"/>
<field name="yuthon_company" optional="hidden"/>
<button name="button_leave" type="object" string="请假" class="oe_highlight" invisible="not (is_abnormal or is_early_card or is_late_card or absenteeism_card or is_no_card)"/>
<button name="button_card_approval" type="object" string="补卡" class="oe_highlight" invisible="not (is_abnormal or is_early_card or is_late_card or absenteeism_card or is_no_card)"/>
<button name="button_duty_approval" type="object" string="外出" class="oe_highlight" invisible="not (is_abnormal or is_early_card or is_late_card or absenteeism_card or is_no_card)"/>
@@ -76,7 +75,7 @@
<field name="domain">[('employee_id.user_id', '=', uid)]</field>
<field name="search_view_id" ref="view_attendance_going_search"/>
</record>
<record id="action_attendance_yuthon_company_form" model="ir.actions.act_window">
<record id="action_attendance_company_form" model="ir.actions.act_window">
<field name="name">考勤记录</field>
<field name="res_model">hr.attendance</field>
<field name="view_mode">tree,form</field>
@@ -7,7 +7,6 @@
<tree>
<field name="name"/>
<field name="users_id"/>
<field name="yuthon_company" optional="hide"/>
<field name="department_id" optional="hide"/>
</tree>
</field>
@@ -66,7 +65,6 @@
<field name="employee_ids" widget="many2many_tags"/>
<field name="department_id" invisible="1"/>
<field name="overtime_hours" readonly="1"/>
<field name="yuthon_company" invisible="1"/>
<field name="type_overtime"/>
<field name="meal" required="1"/>
<field name="details"/>
@@ -5,7 +5,6 @@
<field name="model">overtime.page</field>
<field name="arch" type="xml">
<tree string="加班时长配置">
<field name="yuthon_company"/>
<field name="department_id"/>
</tree>
</field>
@@ -17,9 +16,6 @@
<form string="加班时长配置" create="0">
<sheet>
<group>
<group>
<field name="yuthon_company"/>
</group>
<group>
<field name="department_id"/>
</group>
@@ -7,7 +7,6 @@
<tree string="值班补卡审批">
<field name="name"/>
<field name="users_id"/>
<field name="yuthon_company"/>
<field name="department_id"/>
</tree>
</field>
@@ -55,7 +54,6 @@
<group string="个人信息">
<group>
<field name="users_id"/>
<field name="yuthon_company"/>
<field name="department_id"/>
</group>
</group>
@@ -7,7 +7,6 @@
<tree string="值班调休审批">
<field name="name"/>
<field name="users_id"/>
<field name="yuthon_company"/>
<field name="department_id"/>
</tree>
</field>
@@ -55,7 +54,6 @@
<group col="2">
<group>
<field name="users_id"/>
<field name="yuthon_company"/>
</group>
<group>
<field name="replacement_data"/>
@@ -54,7 +54,6 @@
<field name="employee_id" invisible="1"/>
</group>
<group>
<field name="yuthon_company"/>
<field name="department_id" invisible="1"/>
</group>
</group>
@@ -7,7 +7,6 @@
<tree string="值班换班审批">
<field name="name"/>
<field name="users_id"/>
<field name="yuthon_company" optional="hide"/>
<field name="department_id" optional="hide"/>
</tree>
</field>
@@ -62,7 +61,6 @@
<field name="alternate_id" invisible="alternate_shifts != 'alternate'"/>
<field name="users_id" invisible="1"/>
<field name="transferees_id" invisible="alternate_shifts != 'transferees'"/>
<field name="yuthon_company" invisible="1"/>
<field name="department_id" invisible="1"/>
</group>
<group col="2">
@@ -7,7 +7,6 @@
<tree string="特殊加班">
<field name="name"/>
<field name="users_id"/>
<field name="yuthon_company" optional="hide"/>
<field name="department_id" optional="hide"/>
</tree>
</field>
@@ -59,7 +58,6 @@
<field name="employee_ids" widget="many2many_tags"/>
<field name="start_list_ids" widget="many2many_tags" invisible="1"/>
<field name="users_id" invisible="1"/>
<field name="yuthon_company" invisible="1"/>
</group>
</group>
</sheet>
@@ -26,15 +26,6 @@ class HrAttendanceMonthWizard(models.TransientModel):
('11', '11月份'),
('12', '12月份')
], string="考勤月份")
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'), ('thlc', '天河粮储')],
string='公司', default=lambda self: self._get_default_yuthon_company())
def _get_default_yuthon_company(self):
current_user = self.env.user
employee = self.env['hr.employee'].search([('user_id', '=', current_user.id)], limit=1)
if employee and employee.yuthon_company:
return employee.yuthon_company
return False
def _get_attendance_month_obj(self):
"""
@@ -42,11 +33,9 @@ class HrAttendanceMonthWizard(models.TransientModel):
:return: obj
"""
self.ensure_one()
yuthon_company = self.yuthon_company
attendance_month_obj = self.env["hr.attendance.month"].search([
('current_year', '=', self.current_year),
('current_month', '=', self.current_month),
('yuthon_company', '=', yuthon_company),
], limit=1)
if not attendance_month_obj:
attendance_month_obj = self.env["hr.attendance.month"].sudo().create({
@@ -55,7 +44,6 @@ class HrAttendanceMonthWizard(models.TransientModel):
"current_month": self.current_month,
"is_statistics": True,
"statistics_time": fields.Datetime.now(),
"yuthon_company": yuthon_company,
})
return attendance_month_obj
@@ -66,12 +54,10 @@ class HrAttendanceMonthWizard(models.TransientModel):
:return: 考情明细
"""
self.ensure_one()
yuthon_company = self.yuthon_company
attendance_month_detail_obj = self.env["hr.attendance.month.detail"].search(
[('employee_id', '=', employee.id),
('current_year', '=', self.current_year),
('current_month', '=', self.current_month),
('yuthon_company', '=', yuthon_company)
], limit=1)
if not attendance_month_detail_obj:
attendance_month_detail_obj = self.env["hr.attendance.month.detail"].sudo().create({
@@ -79,7 +65,6 @@ class HrAttendanceMonthWizard(models.TransientModel):
"attendance_year_id": self.attendance_year_id.id,
"current_year": self.current_year,
"current_month": self.current_month,
"yuthon_company": yuthon_company
})
return attendance_month_detail_obj
@@ -89,7 +74,6 @@ class HrAttendanceMonthWizard(models.TransientModel):
:return: ir.actions.act_window 视图 view_hr_attendance_month_detail_tree
"""
self.ensure_one()
yuthon_company = self.yuthon_company
action = {
'type': 'ir.actions.act_window',
'res_model': 'hr.attendance.month.detail',
@@ -99,12 +83,10 @@ class HrAttendanceMonthWizard(models.TransientModel):
'context': {
"current_year": self.current_year,
"current_month": self.current_month,
"yuthon_company": yuthon_company
},
'domain': [
('current_year', '=', self.current_year),
('current_month', '=', self.current_month),
('yuthon_company', '=', yuthon_company),
],
'target': 'main',
'views': [[self.env.ref('yuthon_hr_attendance.view_hr_attendance_month_detail_tree').id, 'list'],
@@ -121,13 +103,12 @@ class HrAttendanceMonthWizard(models.TransientModel):
attendance_month_obj = self._get_attendance_month_obj()
# 查询所有的当前员工? 是否需要判断当前员工是否关联企业微信??预留
user_obj = self.env['res.users'].sudo().search([])
yuthon_company = self.yuthon_company
calendars = self.env['resource.calendar'].search([])
all_employee_ids = set()
for calendar in calendars:
all_employee_ids.update(calendar.resource_user_ids.ids)
all_employee_ids = list(all_employee_ids)
hr_employee_obj = self.env['hr.employee'].sudo().search([("user_id", "in", user_obj.ids), ("yuthon_company", "=", yuthon_company)])
hr_employee_obj = self.env['hr.employee'].sudo().search([("user_id", "in", user_obj.ids)])
# 循环所有员工对每个人进行统计
for employee in hr_employee_obj:
if employee.id not in all_employee_ids:
@@ -157,7 +138,6 @@ class HrAttendanceMonthWizard(models.TransientModel):
wizard = self.create({
'attendance_year_id': attendance_year.id,
'current_month': month,
'yuthon_company':option
})
wizard.search_attendance_month()
@@ -8,7 +8,6 @@
<group>
<field name="attendance_year_id"/>
<field name="current_month" />
<field name="yuthon_company" string="公司名称" invisible="1"/>
</group>
<footer>
<button name="search_attendance_month" id="search_attendance_month" string="开始统计" type="object" class="btn-primary"/>
@@ -104,12 +104,6 @@
<field name='res_model'>hr.applicant</field>
<field name='view_mode'>tree,kanban,form,pivot,graph,calendar,activity</field>
<field name="context">{'search_default_stage':1}</field>
<!-- <field name="domain">[('stage_id.name','!=','人才库')]</field>-->
</record>
<!-- <record id="view_crm_case_categ0_act_job2" model="ir.actions.act_window">-->
<!-- <field name="name">人才库</field>-->
<!-- <field name="res_model">hr.applicant</field>-->
<!-- <field name="view_mode">kanban,tree,form,pivot,graph,calendar,activity</field>-->
<!-- <field name="domain">[('stage_id.name', '=' , '人才库')]</field>-->
<!-- </record>-->
</odoo>
@@ -48,7 +48,6 @@ class HrJob(models.Model):
'hr_job_id': job.id,
'department_id': job.department_id.id,
'job_type_id': job.job_type_id.id,
'yuthon_company': job.yuthon_company,
'establishment_quotas': job.establishment_quotas,
'no_of_employee': job.no_of_employee,
'compiling_external': job.compiling_external,
@@ -21,7 +21,6 @@ class YuthonInterviewApproval(models.Model):
applicant_ids = fields.One2many('interview.approval.line', 'interview_approval_id', string='应聘面试信息')
is_issues = fields.Boolean(string='是否上会')
issues_result = fields.Html(string="会议结果")
yuthon_company = fields.Selection(related='users_id.employee_id.yuthon_company', string="公司")
related_issues_id = fields.Many2one('issue.library', string="关联议题")
active = fields.Boolean('Active', default=True, tracking=True)
room_id = fields.Many2one('room.booking', string="会议室")
@@ -45,7 +44,6 @@ class YuthonInterviewApproval(models.Model):
"views": [[form_id, "form"]],
"context": {
'default_name': self.name,
'default_yuthon_company': self.yuthon_company,
'default_interview_id': self.id,
'default_meeting_type_id': meeting_type_id.id,
'default_room_users_ids': [(6, 0, employee_ids)],
@@ -26,8 +26,6 @@ class YuthonOnboardApproval(models.Model):
employee_name = fields.Char(string='姓名')
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'), ('ttcj','天投城建'),
('thlc', '天河粮储')], string="甲方")
account = fields.Char(string='账号')
reason = fields.Html(string="正文")
work_end = fields.Boolean(string="结束")
@@ -10,7 +10,6 @@ class YuthonPrepareApproval(models.Model):
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_prepare_approval_code'))
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'), ('thlc', '天河粮储')], string="所属公司")
name = fields.Char(string='标题')
reason = fields.Html(string="正文")
is_issues = fields.Boolean(string='是否上会')
@@ -37,7 +36,6 @@ class YuthonPrepareApproval(models.Model):
new_lines.append((0, 0, {
'hr_job_id': new.hr_job_id.id,
'department_id': new.department_id.id,
'yuthon_company': new.yuthon_company,
'job_type_id': new.job_type_id.id,
'compiling_external': new.compiling_external,
@@ -55,7 +53,6 @@ class YuthonPrepareApproval(models.Model):
for prepare in self.prepare_approval_line_ids:
prepare.hr_job_id.write({
'department_id': prepare.department_id.id,
'yuthon_company': prepare.yuthon_company,
'job_type_id': prepare.job_type_id.id,
'compiling_external': prepare.compiling_external,
'establishment_quotas': prepare.establishment_quotas,
@@ -88,8 +85,6 @@ class PrepareApprovalLine(models.Model):
prepare_approval_id = fields.Many2one('yuthon.prepare.approval', string="编制调整需求表")
hr_job_id = fields.Many2one('hr.job', string='工作岗位')
department_id = fields.Many2one("hr.department", string="部门")
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'),
('thlc', '天河粮储')], string="所属公司")
job_type_id = fields.Many2one('hr.job.type', string="岗位类型")
compiling_external = fields.Integer(string="编制外人数")
establishment_quotas = fields.Integer(string="编制人数")
@@ -144,8 +139,6 @@ class NewPrepareApprovalLine(models.Model):
prepare_approval_id = fields.Many2one('yuthon.prepare.approval', string="编制调整需求表")
hr_job_id = fields.Many2one('hr.job', string='工作岗位')
department_id = fields.Many2one("hr.department", string="部门")
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'),
('thlc', '天河粮储')], string="所属公司")
job_type_id = fields.Many2one('hr.job.type', string="岗位类型")
compiling_external = fields.Integer(string="编制外人数")
establishment_quotas = fields.Integer(string="编制人数")
@@ -13,7 +13,6 @@ class YuthonReassignmentApproval(models.Model):
code = fields.Char(string="编号",
default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_reassignment_approval_code'))
phone = fields.Char(related='employee_id.work_phone',string='联系电话')
yuthon_company = fields.Selection(related='employee_id.yuthon_company', string="任职单位")
job_id = fields.Many2one(related='employee_id.job_id', string="主岗")
duties_id = fields.Many2one(related='employee_id.job_id', string="职务")
onboarding_date = fields.Date(related='employee_id.open_start_time', string="任职日期")
@@ -40,8 +39,6 @@ class YuthonReassignmentApproval(models.Model):
change_kind = fields.Char(string="异动类型")
change_reason = fields.Char(string="异动原因")
change_date = fields.Date(string="调动日期")
change_yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'),
('thlc', '天河粮储')], string="任职单位")
handover_date = fields.Date(string="移交日期")
handover_person_id = fields.Many2one("hr.employee", string="工作接交人")
notification_change_id = fields.Many2one("hr.employee", string="异动告知人员")
@@ -18,8 +18,6 @@ class YuthonRecruitmentApproval(models.Model):
issues_result = fields.Html(string="会议结果")
related_issues_id = fields.Many2one('issue.library', string="关联议题")
notice_documents_ids = fields.Many2many('ir.attachment', string='议题附件')
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'),
('thlc', '天河粮储')], string="所属公司")
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度',
default='normal')
@@ -15,8 +15,6 @@ class YuthonRegularizationPrepareApproval(models.Model):
default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_regularization_approval_code'))
job_id = fields.Many2one(related='employee_id.job_id', string="主岗")
phone = fields.Char(related='employee_id.mobile_phone', string='手机号')
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'),
('thlc', '天河粮储')], string="任职单位")
onboarding_time = fields.Date(string="入职日期")
trial_end_date = fields.Date(related='employee_id.open_start_time', string="试用期结束日期")
parent_id = fields.Many2one(related='employee_id.parent_id',string="直线上级")
@@ -11,8 +11,6 @@ class YuthonRewardApproval(models.Model):
text = fields.Text(string='正文')
code = fields.Char(string="编号",
default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_salary_approval_code'))
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'),
('thlc', '天河粮储')], string="所属公司")
users_id = fields.Many2one('res.users', string="录入人", default=lambda self: self.env.user.id)
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
entrant_date = fields.Date(string="录入日期")
@@ -14,8 +14,6 @@ class YutransferApproval(models.Model):
default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_leaving_approval_code'))
users_id = fields.Many2one('res.users', string="录入人", default=lambda self: self.env.user.id)
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'),
('thlc', '天河粮储')], string="所属公司")
main_post = fields.Many2one("hr.job", string="主岗")
duties = fields.Char(string="职务")
job_type_id = fields.Many2one('hr.job.type', string="岗位类别")
@@ -55,7 +55,6 @@
<field name="work_end" invisible="1"/>
<field name="is_issues" invisible="is_issues == False"/>
<field name="department_id" invisible="1"/>
<field name="yuthon_company" invisible="1"/>
</group>
<notebook>
<page string="应聘面试信息">
@@ -6,7 +6,6 @@
<field name="arch" type="xml">
<tree>
<field name="code"/>
<field name="yuthon_company"/>
<field name="onboard_time"/>
</tree>
</field>
@@ -56,7 +55,6 @@
<group col="2" string="甲方信息">
<group>
<field name="employee_id"/>
<field name="yuthon_company"/>
<field name="onboarding_status"/>
</group>
<group>
@@ -46,7 +46,6 @@
<field name="work_end" invisible="1"/>
<field name="users_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="yuthon_company" invisible="1"/>
</group>
<group>
<field name="department_id" invisible="1"/>
@@ -67,7 +66,6 @@
<field name="prepare_approval_id" column_invisible="1"/>
<field name="department_id"/>
<field name="job_type_id"/>
<field name="yuthon_company"/>
<field name="establishment_quotas"/>
<field name="no_of_employee"/>
<field name="compiling_external"/>
@@ -85,7 +83,6 @@
<field name="prepare_approval_id" column_invisible="1"/>
<field name="department_id"/>
<field name="job_type_id"/>
<field name="yuthon_company"/>
<field name="establishment_quotas"/>
<field name="no_of_employee"/>
<field name="compiling_external"/>
@@ -55,7 +55,6 @@
<field name="work_end" invisible="1"/>
<field name="users_id"/>
<field name="department_id"/>
<field name="yuthon_company"/>
<field name="parent_id"/>
</group>
<group>
@@ -85,7 +84,6 @@
<field name="change_business_superior_id"/>
</group>
<group>
<field name="change_yuthon_company"/>
<field name="change_job_id"/>
</group>
<group>
@@ -53,7 +53,6 @@
<field name="issues_result" invisible="is_issues == False"/>
<field name="notice_documents_ids" widget="preview_many2many"/>
<field name="department_id"/>
<field name="yuthon_company" invisible="1"/>
</group>
<notebook>
<page string="岗位">
@@ -64,7 +63,6 @@
<field name="name"/>
<field name="department_id"/>
<field name="job_type_id"/>
<field name="yuthon_company" column_invisible="1"/>
<field name="establishment_quotas" column_invisible="1"/>
<field name="no_of_employee" column_invisible="1"/>
<field name="compiling_external" column_invisible="1"/>
@@ -7,7 +7,6 @@
<tree>
<field name="name"/>
<field name="code"/>
<field name="yuthon_company"/>
<field name="users_id"/>
<field name="entrant_date"/>
<field name="entrant_date"/>
@@ -53,7 +52,6 @@
</group>
<group string="基础信息" col="3">
<group>
<field name="yuthon_company" invisible="1"/>
<field name="department_id"/>
</group>
<group>
@@ -7,7 +7,6 @@
<tree>
<field name="code"/>
<field name="users_id"/>
<field name="yuthon_company"/>
<field name="main_post"/>
<field name="duties"/>
<field name="onboarding_date"/>
@@ -58,7 +57,6 @@
<group col="4" string="员工信息">
<group>
<field name="employee_id"/>
<field name="yuthon_company" invisible="1"/>
<field name="onboarding_date"/>
</group>
<group>
+1 -1
View File
@@ -13,7 +13,6 @@
'depends': ['mail', 'documents', 'room', 'soong_workflow'],
'data': [
'security/issue_security_group.xml',
'security/issue_approval_decision_rule.xml',
'security/ir.model.access.csv',
'data/issue_library_code_data.xml',
'views/issue_library_views.xml',
@@ -34,4 +33,5 @@
},
'installable': True,
'application': True,
}
@@ -8,8 +8,6 @@ class RoomBooking(models.Model):
is_issue = fields.Boolean(string="是否关联议题")
issue_meeting_line_ids = fields.One2many('issue.meeting.line', 'meeting_booking_id', string="关联议题明细行")
number_of_meetings = fields.Integer(string='会议次数')
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'), ('thlc', '天河粮储')],
string='公司')
def bottom_meeting_approval(self):
library_data = []
@@ -32,7 +30,6 @@ class RoomBooking(models.Model):
'default_meeting_type_id': self.meeting_type_id.id,
'default_meeting_date': self.start_datetime,
'default_number_of_meetings': self.number_of_meetings,
'default_yuthon_company':self.yuthon_company,
'default_meeting_minutes_ids': library_data
}}
-3
View File
@@ -14,9 +14,6 @@ class IssueApproval(models.Model):
create_time = fields.Date(string='创建日期', default=lambda self: fields.Date.today())
employee_id = fields.Many2one('hr.employee', string="经办人", default=lambda self: self.env.user.employee_id)
department_id = fields.Many2one(related='employee_id.department_id', string="部门")
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'), ('thlc', '天河粮储'),
('thtjbb', '集团本部')],
related='employee_id.yuthon_company', string="所属公司")
user_id = fields.Many2one('res.users', string="经办人", default=lambda self: self.env.user)
meeting_details = fields.Char(string="会议详情")
job_id = fields.Many2one(related='employee_id.job_id', string="岗位")
@@ -15,8 +15,6 @@ class IssueApprovalDecision(models.Model):
team_meet = fields.Selection([('approval', '审'), ('decide', '决')], string='经营班子会')
board_meet = fields.Selection([('approval', '审'), ('decide', '决'), ('commission', '授权投决会')], string='董事会', compute='_compute_board_meet', readonly=False)
district_bureau = fields.Selection([('record', '备案'), ('approved', '核准'), ('record_approved', '备案、核准')], string='上级单位')
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'),
('thlc', '天河粮储')], string="所属公司")
department_id = fields.Many2one('hr.department', string="部门")
start_date = fields.Date(string="生效日期")
end_date = fields.Date(string="失效日期")
-2
View File
@@ -37,8 +37,6 @@ class IssueLibrary(models.Model):
# 权限相关隐藏字段
employee_id = fields.Many2one('hr.employee', string='创建人', default=lambda self: self.env.user.employee_id)
department_id = fields.Many2one('hr.department', string='部门', related='employee_id.department_id')
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'),
('thlc', '天河粮储')], string="所属公司", related='employee_id.yuthon_company')
users_role_ids = fields.Many2many('soong.user.role', string='角色范围', related='employee_id.user_role_ids')
approval_name = fields.Char(string="审批标题")
meeting_place = fields.Char(string="会议地点")
+1 -2
View File
@@ -11,8 +11,7 @@ class IssueMeetingMinutes(models.Model):
name = fields.Char(string='名称')
number_of_meetings = fields.Integer(string='会议次数')
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'), ('thlc', '天河粮储')],
string='公司')
meeting_id = fields.Many2one('room.booking', string='会议名称', required=True)
meeting_type_id = fields.Many2one('room.meeting.type', string="会议类型")
meeting_date = fields.Datetime(string="会议时间")
@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="issue_approval_decision_rule" model="ir.rule">
<field name="name">决策清单公司过滤</field>
<field name="model_id" ref="model_issue_approval_decision"/>
<field name="domain_force">[('yuthon_company', '=', user.employee_id.yuthon_company)]</field>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_create" eval="True"/>
<field name="perm_unlink" eval="True"/>
</record>
<record id="issue_approval_rule" model="ir.rule">
<field name="name">议题审批公司过滤</field>
<field name="model_id" ref="model_issue_approval"/>
<field name="domain_force">[('yuthon_company', '=', user.employee_id.yuthon_company)]</field>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_create" eval="True"/>
<field name="perm_unlink" eval="True"/>
</record>
</odoo>
@@ -13,10 +13,4 @@
<field name="implied_ids" eval="[(4, ref('group_issue_user'))]"/>
<field name="users" eval="[(4, ref('base.user_admin'))]"/>
</record>
<record id="yuthon_issue_company_rule_manager" model="ir.rule">
<field name="name">yuthon_issue_company_rule_admin</field>
<field name="model_id" ref="model_issue_library"/>
<field name="domain_force">[('yuthon_company', '=', user.employee_id.yuthon_company)]</field>
<field name="groups" eval="[(4, ref('group_issue_admin'))]"/>
</record>
</odoo>
@@ -14,7 +14,7 @@
<field name="board_meet"/>
<field name="district_bureau"/>
<field name="remarks"/>
<field name="yuthon_company" optional="hide"/>
<field name="department_id" optional="hide"/>
<field name="start_date" optional="hide"/>
<field name="end_date" optional="hide"/>
@@ -47,7 +47,6 @@
<group>
<field name="board_meet"/>
<field name="start_date"/>
<field name="yuthon_company"/>
<field name="department_id"/>
</group>
<group>
@@ -8,7 +8,6 @@
<field name="issue_data" column_invisible="1"/>
<field name="decision_data" column_invisible="1"/>
<field name="name"/>
<field name="yuthon_company"/>
<field name="department_id"/>
<field name="issue_display" widget="json_template"/>
<field name="decision_display" widget="json_template"/>
@@ -53,9 +52,6 @@
<field name="employee_id"/>
<field name="is_attend"/>
</group>
<group>
<field name="yuthon_company"/>
</group>
<group>
<field name="job_id"/>
</group>
@@ -71,7 +71,6 @@
<group>
<field name="employee_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="yuthon_company" invisible="1"/>
<field name="users_role_ids" invisible="1" widget="many2many_tags"/>
</group>
</group>
@@ -189,7 +188,6 @@
<group>
<field name="employee_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="yuthon_company" invisible="1"/>
<field name="users_role_ids" invisible="1" widget="many2many_tags"/>
<field name="cs_party" invisible="1"/>
<field name="cs_class" invisible="1"/>
@@ -370,7 +368,6 @@
<group>
<field name="employee_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="yuthon_company" invisible="1"/>
<field name="users_role_ids" invisible="1" widget="many2many_tags"/>
<field name="cs_party" invisible="1"/>
<field name="cs_class" invisible="1"/>
@@ -481,7 +478,6 @@
<group>
<field name="employee_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="yuthon_company" invisible="1"/>
<field name="users_role_ids" invisible="1" widget="many2many_tags"/>
</group>
</group>
@@ -646,7 +642,6 @@
<group>
<field name="employee_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="yuthon_company" invisible="1"/>
<field name="users_role_ids" invisible="1" widget="many2many_tags"/>
</group>
</group>
@@ -755,7 +750,6 @@
<group>
<field name="employee_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="yuthon_company" invisible="1"/>
<field name="users_role_ids" invisible="1" widget="many2many_tags"/>
</group>
</group>
@@ -909,7 +903,6 @@
<group>
<field name="employee_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="yuthon_company" invisible="1"/>
<field name="users_role_ids" invisible="1" widget="many2many_tags"/>
</group>
</group>
@@ -1031,7 +1024,6 @@
<group>
<field name="employee_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="yuthon_company" invisible="1"/>
<field name="users_role_ids" invisible="1" widget="many2many_tags"/>
</group>
</group>
@@ -48,7 +48,6 @@
</group>
<group>
<field name="number_of_meetings" invisible="1"/>
<field name="yuthon_company" invisible="1"/>
</group>
</group>
<notebook>
-1
View File
@@ -14,7 +14,6 @@
'data': [
'security/ir.model.access.csv',
'security/yuthon_notice_group.xml',
'security/yuthon_notice_rule.xml',
'data/notice_code_data.xml',
'data/notice_cron_data.xml',
'data/notice_type_data.xml',
-1
View File
@@ -14,7 +14,6 @@ class YuthonNotice(models.Model):
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('notice_code'))
users_id = fields.Many2one('res.users', string="发布人", default=lambda self: self.env.user)
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
yuthon_company = fields.Selection(related='users_id.employee_id.yuthon_company', string="发布公司")
notice_type_id = fields.Many2one('yuthon.notice.type', string="类型")
create_date = fields.Date(string="发布日期", default=fields.Date.today())
start_date = fields.Date(string="生效日期", default=fields.Date.today())
@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!-- <record id="yuthon_notice_company_rule_user" model="ir.rule">-->
<!-- <field name="name">yuthon_notice_company_rule_user</field>-->
<!-- <field name="model_id" ref="model_yuthon_notice"/>-->
<!-- <field name="domain_force">[('employee_ids', 'in', [user.employee_id.id])]</field>-->
<!-- <field name="groups" eval="[(4, ref('group_notice_user'))]"/>-->
<!-- </record>-->
<record id="yuthon_notice_company_rule_manager" model="ir.rule">
<field name="name">yuthon_notice_company_rule_admin</field>
<field name="model_id" ref="model_yuthon_notice"/>
<field name="domain_force">[('yuthon_company', '=', user.employee_id.yuthon_company)]</field>
<field name="groups" eval="[(4, ref('group_notice_admin'))]"/>
</record>
</odoo>
@@ -12,7 +12,6 @@
<field name="users_id" string="发布人"/>
<field name="department_id" column_invisible="1"/>
<field name="users_ids" column_invisible="1"/>
<field name="yuthon_company" optional="hide"/>
<field name="create_date"/>
<field name="start_date"/>
<field name="end_date"/>
@@ -60,9 +59,6 @@
<group>
<field name="users_id" required="1"/>
</group>
<group>
<field name="yuthon_company"/>
</group>
<group>
<field name="work_end" invisible="1"/>
<field name="department_id" string="发布部门" invisible="1"/>
@@ -115,7 +111,6 @@
<field name="users_id" string="发布人"/>
<field name="is_notice_roger"/>
<field name="department_id" column_invisible="1"/>
<field name="yuthon_company" column_invisible="1"/>
<field name="users_ids" column_invisible="1"/>
<field name="create_date"/>
<field name="start_date" column_invisible="1"/>
@@ -11,7 +11,6 @@ class YuthonOfficialIncomingNormal(models.Model):
name = fields.Char(string="标题")
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('official_code'))
yuthon_company = fields.Selection(related='users_id.employee_id.yuthon_company', string="公司")
official_type_id = fields.Many2one('official.type', string="公文种类")
reference_cold = fields.Integer(string="来文字号")
reference_date = fields.Date(string='来问日期')
@@ -58,7 +58,6 @@
<field name="remarks"/>
</group>
<group>
<field name="yuthon_company"/>
<field name="users_id"/>
<field name="department_id"/>
<field name="main_flats"/>
@@ -6,8 +6,6 @@ class YuthonAssessmentTasks(models.Model):
_description = '考核任务总汇'
name = fields.Char(string='考核任务名称')
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'),
('thlc', '天河粮储')], string="所属公司")
index_statu = fields.Selection([('work', '生效'), ('void', '作废')], string='状态')
performance_type = fields.Selection([('organize', '组织绩效'), ('employs', '员工绩效')], stroing='考核类型')
assessment_time = fields.Char(string='考核时间')
@@ -21,8 +21,6 @@ class YuthonDutyManagement(models.Model):
default=lambda self: self._get_default_month())
select_quarter = fields.Selection([('one', '第一季度'), ('two', '第二季度'), ('three', '第三季度'), ('four', '第四季度')]
, string='季度')
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'),
('thlc', '天河粮储')], string="所属公司")
department_id = fields.Many2one("hr.department", string="被考核部门", required=True)
start_index_time = fields.Date('指标生效时间')
end_index_time = fields.Date('指标失效时间')
@@ -6,8 +6,6 @@ class YuthonEmployeeAppraisal(models.Model):
_description = '员工绩效考核表'
name = fields.Char(string='名称')
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'),
('thlc', '天河粮储')], string="所属公司")
apply = fields.Char(string='本表适用于')
examiners = fields.Char(string='考核者')
evaluation_time = fields.Date(string='评价时间')
@@ -10,8 +10,6 @@ class YuthonEmployeeApproval(models.Model):
name = fields.Char('标题')
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'),
('thlc', '天河粮储')], string="所属公司")
dimension = fields.Char('评价维度', required=True)
creation_time = fields.Datetime(string='申请日期', default=lambda self: fields.Datetime.now())
job_id = fields.Many2one('hr.job', string="岗位")
@@ -8,8 +8,6 @@ class YuthonEmployeePerformance(models.Model):
name = fields.Char('标题')
assessment_time = fields.Char('考核时间', required=True)
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'),
('thlc', '天河粮储')], string="所属公司")
cycle = fields.Selection([('monthly', '月度'),
('quarter', '季度'),
('up_half', '上半年'),
@@ -9,8 +9,6 @@ class YuthonGradingTasks(models.Model):
department_id = fields.Many2one("hr.department", string="部门", required=True)
index_time = fields.Date(string='时间')
gs_ids = fields.One2many("yuthon.gs.detail.lines", "gs_id", string="GS评分表明细行")
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'),
('thlc', '天河粮储')], string="所属公司")
@@ -9,8 +9,6 @@ class YuthonIndexApproval(models.Model):
name = fields.Char('标题')
creation_time = fields.Datetime(string='申请日期', default=lambda self: fields.Datetime.now())
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'),
('thlc', '天河粮储')], string="所属公司")
job_id = fields.Many2one('hr.job', string="岗位")
reason_text = fields.Html(string='申请事由')
code = fields.Char(string="编号",
@@ -14,8 +14,6 @@ class YuthonIndexEmployee(models.Model):
in_charge_role_id = fields.Many2one('soong.user.role', string='角色', domain=[('user_type', '!=', 'lv_role')])
employee_ids = fields.Many2many('hr.employee', string='人员范围')
department_ids = fields.Many2many('hr.department', string='部门')
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'),
('thlc', '天河粮储')], string="所属公司")
change_employee_library_id = fields.Many2one('yuthon.employee.approval', string='变更指标库')
def put_employees_approval(self):
@@ -18,8 +18,6 @@ class YuthonIndexManagement(models.Model):
('good_index', '正向指标'),
('two_index', '双向指标'),],'计算类别')
check_norm = fields.Text('考核标准')
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'),
('thlc', '天河粮储')], string="所属公司")
department_ids = fields.Many2many("hr.department", string="指标来源")
in_charge_role_id = fields.Many2one('soong.user.role', string='角色', domain=[('user_type', '!=', 'lv_role')])
employee_ids = fields.Many2many('hr.employee', string='人员范围')
@@ -9,8 +9,6 @@ class YuthonKpiTasks(models.Model):
department_id = fields.Many2one("hr.department", string="部门", required=True)
index_time = fields.Date(string='时间')
kpi_ids = fields.One2many('yuthon.kpi.detail.lines', 'kpi_id', string='KPI明细')
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'),
('thlc', '天河粮储')], string="所属公司")
class YuthonKpiDetailLines(models.Model):
@@ -12,8 +12,6 @@ class YuthonPlanManagement(models.Model):
('May', '五月'), ('June', '六月'), ('July', '七月'), ('July', '八月'),
('September', '九月'), ('October', '十月'), ('November', '十一月'), ('December', '十二月')
,('half', '上半年'), ('later', '下半年'), ('year', '年度')], string='选择时间', default=lambda self: self._get_default_month())
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'),
('thlc', '天河粮储')], string="所属公司")
work_tasks_line_ids = fields.One2many('yuthon.work.tasks.line','plan_id',string='工作任务明细')
plan_management_ids = fields.One2many('yuthon.plan.management.line','plan_id',string='计划管理明细')
@@ -10,8 +10,6 @@ class YuthonTissueDutyApproval(models.Model):
name = fields.Char('标题')
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'),
('thlc', '天河粮储')], string="所属公司")
creation_time = fields.Datetime(string='申请日期', default=lambda self: fields.Datetime.now())
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('duty_approval_code'))
job_id = fields.Many2one('hr.job', string="岗位")
@@ -9,7 +9,6 @@
<field name="performance_type" string="绩效类型"/>
<field name="assessment_time" string="考核时间"/>
<field name="index_statu"/>
<field name="yuthon_company" optional="hide"/>
<button name="button_appraisal_ids" type="object" string="考核详情"/>
<button name="button_clone_task" type="object" string="克隆"/>
<button name="button_calculate_score" type="object" string="计算分数"/>
@@ -33,7 +32,6 @@
<group col="2">
<group>
<field name="performance_type" string="绩效类型"/>
<field name="yuthon_company"/>
</group>
<group>
<field name="assessment_time" string="考核时间"/>
@@ -6,7 +6,6 @@
<field name="arch" type="xml">
<tree string="责任书">
<field name="department_id"/>
<field name="yuthon_company" optional="hide"/>
<field name="name"/>
<field name="start_index_time"/>
<field name="end_index_time"/>
@@ -29,7 +28,6 @@
<group>
<group>
<field name="work_end" invisible="1"/>
<field name="yuthon_company"/>
<field name="department_id"/>
<field name="total_weights"/>
</group>
@@ -10,7 +10,6 @@
<field name="apply"/>
<field name="examiners"/>
<field name="evaluation_time"/>
<field name="yuthon_company" optional="hide"/>
</tree>
</field>
</record>
@@ -34,7 +33,6 @@
</group>
<group>
<field name="evaluation_time"/>
<field name="yuthon_company"/>
</group>
</group>
<group col="2" string="被考核者的基本信息">
@@ -10,7 +10,6 @@
<field name="users_id"/>
<field name="department_id"/>
<field name="creation_time"/>
<field name="yuthon_company" optional="hide"/>
</tree>
</field>
</record>
@@ -31,7 +30,6 @@
<field name="work_end" invisible="1"/>
<field name="job_id"/>
<field name="department_id"/>
<field name="yuthon_company"/>
</group>
<group/>
</group>
@@ -8,7 +8,6 @@
decoration-danger="index_statu == 'void'"
decoration-success="index_statu == 'work'">
<field name="department_id"/>
<field name="yuthon_company" optional="hide"/>
<field name="name"/>
<field name="start_index_time"/>
<field name="end_index_time"/>
@@ -37,7 +36,6 @@
<group>
<field name="assessment_time"/>
<field name="cycle"/>
<field name="yuthon_company"/>
</group>
</group>
<notebook>
@@ -9,7 +9,6 @@
<field name="name"/>
<field name="department_id"/>
<field name="index_time"/>
<field name="yuthon_company" optional="hide"/>
</tree>
</field>
</record>
@@ -26,8 +25,7 @@
</div>
<group col="2">
<group>
<field name="department_id"/>
<field name="yuthon_company"/>
<field name="department_id"/>
</group>
<group>
<field name="index_time"/>
@@ -8,7 +8,6 @@
<tree>
<field name="name"/>
<field name="creation_time"/>
<field name="yuthon_company" optional="hide"/>
</tree>
</field>
</record>
@@ -26,7 +25,6 @@
</group>
<group>
<field name="job_id"/>
<field name="yuthon_company"/>
</group>
<group/>
</group>

Some files were not shown because too many files have changed in this diff Show More