添加功能
This commit is contained in:
@@ -181,7 +181,7 @@
|
||||
</group>
|
||||
<group>
|
||||
<field name="circulated_employee_ids" widget="many2many_tags" options="{'no_create': True}"
|
||||
domain="[('id', 'in', employee_ids2),('user_state', 'not in', ['withdraw', 'leave'])]"/>
|
||||
domain="[('id', 'in', employee_ids2)]"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="supervising_employee_ids" widget="many2many_tags" invisible="not is_supervising"
|
||||
|
||||
@@ -15,4 +15,5 @@ from . import yuthon_medical_manage
|
||||
from . import yuthon_medical_rule
|
||||
from . import res_users
|
||||
from . import yuthon_hr_task
|
||||
from . import inherit_soong_workflow_comment_wizard
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
from odoo import models, api
|
||||
|
||||
|
||||
class SoongWorkflowCommentWizardInherit(models.Model):
|
||||
_inherit = 'soong.workflow.comment.wizard'
|
||||
|
||||
@api.onchange('scope_type', 'department_id', 'company_id')
|
||||
def _onchange_employee_ids2(self):
|
||||
domain = []
|
||||
if self.scope_type == 'company':
|
||||
domain.append(('company_id', '=', self.company_id.id))
|
||||
elif self.scope_type == 'department':
|
||||
department = self.env.user.department_id
|
||||
if department:
|
||||
all_depts = department.child_ids | department
|
||||
domain.extend([
|
||||
('company_id', '=', self.company_id.id),
|
||||
'|',
|
||||
('department_id', 'in', all_depts.ids),
|
||||
('department_ids', 'in', all_depts.ids),
|
||||
])
|
||||
# 排除离职和退休
|
||||
domain.append(('user_state', 'not in', ['leave', 'withdraw']))
|
||||
self.employee_ids2 = self.env['hr.employee'].search(domain)
|
||||
Reference in New Issue
Block a user