pengyuthon

This commit is contained in:
李鹏宇
2024-09-23 09:49:39 +08:00
parent 6fcef6871d
commit 663db15c97
7 changed files with 48 additions and 5 deletions
+1 -1
View File
@@ -6,5 +6,5 @@ class SoongNote(models.Model):
_name = 'soong.note'
name = fields.Char(string="审批意见")
type = fields.Selection([('agree', '同意'), ('return', '退回'), ('refuse', '拒绝')], string="意见类型")
type = fields.Selection([('agree', '同意'), ('return', '退回'), ('refuse', '拒绝'), ('super', '督办')], string="意见类型")
return_type = fields.Char(string="退回类型")
@@ -104,6 +104,15 @@ class SoongWorkflowNode(models.Model):
"action_type": "code",
"code": "obj.action_withdraw()",
},)]
elif val['node_name'] == '分发':
val["button_ids"] = [
(0, 0, {
"name": _("分发"),
"workflow_id": val['workflow_id'],
"sequence": 1,
"action_type": "code",
"has_comment": True,
},)]
else:
val["button_ids"] = [
(0, 0, {
@@ -25,6 +25,32 @@ class SoongWorkflowCommentWizard(models.TransientModel):
trans_link_id = fields.Many2one('trans.link', string='转交节点')
return_link_id = fields.Many2one('trans.link', string='退回节点')
send_type = fields.Selection([('send', '分发'), ('super', '督办')], default='send', string="动作类型")
department_id = fields.Many2one('hr.department', string="承办部门")
start_date = fields.Date(string="开始日期", default=fields.Date.today())
end_date = fields.Date(string="结束日期")
department_ids = fields.Many2many('hr.department', string='部门范围')
employee_ids = fields.Many2many('hr.employee', string='人员范围')
users_role_ids = fields.Many2many('soong.user.role', string='角色范围')
approval_users_ids = fields.Many2many('res.users', string="传阅/督办人员", compute="compute_approval_users_ids", store=True)
@api.depends('department_ids', 'employee_ids', 'users_role_ids')
def compute_approval_users_ids(self):
department_users_list = users_role_list = []
for users in self:
if users.department_ids:
for depart in users.department_ids:
department_users_data = users.env['hr.employee'].search([('department_id', '=', depart.id)])
department_users_list = [de.user_id.id for de in department_users_data]
employee_users_list = users.employee_ids.user_id.ids
if users.users_role_ids:
for user_id in users.users_role_ids:
user_role_data = users.env['hr.employee'].search([('user_role_id', '=', user_id.id)])
users_role_list = [ro.user_id.id for ro in user_role_data]
publish_user_list = department_users_list + employee_users_list + users_role_list
users.approval_users_ids = [(6, 0, list(set(publish_user_list)))]
@api.onchange('record_id')
def _onchange_record_id(self):
record_id = self.env[self.res_model].search([('id', '=', self.res_id)])
@@ -19,8 +19,17 @@
<field name="comment_return_type" invisible="node_btn_name != '退回'" required="node_btn_name != '退回'"/>
<!-- 转交人员 -->
<field name="trans_link_id" invisible="not node_link_len" string="转交节点"/>
<field name="comment_note_id" invisible="node_btn_name != '转交'" string="意见" domain="[('type','=','agree')]"/>
<field name="comment_note_id" invisible="node_btn_name != '转交'" string="转交意见" domain="[('type','=','agree')]"/>
<field name="notice_message" invisible="node_btn_name != '转交'"/>
<!-- 分发 -->
<field name="send_type" invisible="node_btn_name != '分发'" widget="radio"/>
<field name="start_date" invisible="send_type != 'super'"/>
<field name="end_date" invisible="send_type != 'super'"/>
<field name="comment_note_id" invisible="node_btn_name != '分发'" string="督办意见" domain="[('type','=','super')]"/>
<field name="department_ids" invisible="node_btn_name != '分发'" widget="many2many_tags"/>
<field name="employee_ids" invisible="node_btn_name != '分发'" widget="many2many_tags"/>
<field name="users_role_ids" invisible="node_btn_name != '分发'" widget="many2many_tags"/>
<field name="approval_users_ids" invisible="node_btn_name != '分发'" widget="many2many_tags"/>
</group>
<footer>
<button name="add_comment" string="确认" type="object" class="oe_highlight"/>
@@ -5,7 +5,7 @@
<field name="model">hr.job</field>
<field name="inherit_id" ref="hr.view_hr_job_tree"/>
<field name="arch" type="xml">
<xpath expr="." position="inside">
<xpath expr="//field[@name='sequence']" position="before">
<header>
<button name="pub_applicant_approval_button" string="提交需求申请" type="object"/>
<button name="pub_prepare_approval_button" string="提交岗位编制调整申请" type="object"/>
@@ -11,6 +11,5 @@ class PropertyLeaseContract(models.Model):
_rec_name = 'name'
name = fields.Char(string='标题')
code = fields.Char(string="编号",
default=lambda self: self.env['ir.sequence'].next_by_code('property_lease_contract_code'))
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('property_lease_contract_code'))
property_documents_ids = fields.Many2many('documents.document', string="租赁合同文件")
Binary file not shown.