@@ -131,6 +131,9 @@ class SoongWorkflowMixin(models.AbstractModel):
|
||||
current_user_role_ids.extend(employee.user_role_ids.ids)
|
||||
|
||||
for button_id in button_ids:
|
||||
allowed_departments = button_id.node_id.department_id
|
||||
if allowed_departments and employee.department_id.id not in allowed_departments.ids:
|
||||
continue
|
||||
allowed_role_ids = []
|
||||
if button_id.users_role_id:
|
||||
allowed_role_ids.append(button_id.users_role_id.id)
|
||||
@@ -138,7 +141,6 @@ class SoongWorkflowMixin(models.AbstractModel):
|
||||
allowed_role_ids.extend(button_id.users_role_group_ids.user_role_ids.ids)
|
||||
else:
|
||||
continue
|
||||
|
||||
if current_user_role_ids and any(role_id in allowed_role_ids for role_id in current_user_role_ids):
|
||||
record.state = button_id.node_id.node_name
|
||||
return res
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
<field name="name"
|
||||
string="综合搜索"
|
||||
filter_domain="['|', '|', '|', ('name', 'ilike', self), ('code', 'ilike', self), ('text', 'ilike', self), ('workflow_id.name', 'ilike', self)]"/>
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="done_by"/>
|
||||
<field name="workflow_id" string="审批类型"/>
|
||||
|
||||
@@ -392,7 +392,7 @@ class SoongWorkflowCommentWizard(models.TransientModel):
|
||||
|
||||
for employee in self.employee_ids:
|
||||
action_id = self.env['ir.actions.act_window'].search([('res_model', '=', self.res_model)])[0]
|
||||
url = f'https://oa.thtzjt.com/web?login={employee.user_id.login}&oauth_uid={employee.wecom_userid}#id={record_id.id}&cids=2&action={action_id.id}&model={record_id._name}&view_type=form'
|
||||
url = f'https://oa.thtzjt.com/web?login={employee.user_id.login}&oauth_uid={employee.wecom_userid}#id={record_id.id}&cids=2&action={action_id.id}&model={record_id._name}&view_type=form&menu_id=10104'
|
||||
self.sudo().env["wecom.apps"].sync_send_message_textcard(category='oa',
|
||||
user_id=employee.wecom_userid,
|
||||
title=record_id._description,
|
||||
|
||||
Reference in New Issue
Block a user