47 lines
2.0 KiB
Python
47 lines
2.0 KiB
Python
from odoo import models, fields, api, exceptions, _
|
|
|
|
|
|
class YuthonIndexEmployee(models.Model):
|
|
_name = 'yuthon.index.employee'
|
|
_description = '员工绩效标准库'
|
|
|
|
start_index_time = fields.Date(string='生效时间', required=True)
|
|
end_index_time = fields.Date(string='失效时间')
|
|
assessment_items = fields.Text(string='考核项目')
|
|
score_range_on = fields.Float(string='分值范围')
|
|
score_range_off = fields.Float(string='分值范围')
|
|
description_score = fields.Text(string='分值说明')
|
|
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):
|
|
form_id = self.env.ref('yuthon_performance.yuthon_employee_approval_form').id
|
|
index_applicant_ids = self.env["yuthon.index.employee"].browse(
|
|
self._context.get('active_ids', self._context.get('active_id')))
|
|
index_applicant_data = [(6, 0, index_applicant_ids.ids)]
|
|
return {
|
|
'name': '员工责任变更明细',
|
|
'type': 'ir.actions.act_window',
|
|
'view_mode': 'form',
|
|
'res_model': 'yuthon.employee.approval',
|
|
'views': [(form_id,'form')],
|
|
'context': {'default_change_employee_library_ids':index_applicant_data
|
|
}}
|
|
|
|
def put_assessment_tasks1_approval(self):
|
|
pass
|
|
|
|
def open_record(self):
|
|
return {
|
|
"type": "ir.actions.act_window",
|
|
"res_model": 'yuthon.index.employee',
|
|
"res_id": self.id,
|
|
"name":"员工详情",
|
|
"view_mode": "form",
|
|
}
|
|
|