1
This commit is contained in:
@@ -869,7 +869,7 @@ class SoongWorkflowMixin(models.AbstractModel):
|
||||
id_el = etree.Element("field")
|
||||
id_el.set("name", "log_ids")
|
||||
id_el.set("invisible", "1")
|
||||
field_inst.set("readonly", "state in %s and log_ids" % readonly_arr)
|
||||
field_inst.set("readonly", "state in %s" % readonly_arr)
|
||||
if required_arr:
|
||||
field_inst.set("required", "state in %s" % required_arr)
|
||||
if invisible_arr:
|
||||
@@ -991,6 +991,7 @@ class SoongWorkflowLine(models.Model):
|
||||
"view_mode": "form",
|
||||
}
|
||||
|
||||
|
||||
class ProjectProjectLine(models.Model):
|
||||
_name = "project.project.line"
|
||||
|
||||
|
||||
@@ -28,14 +28,13 @@
|
||||
</page>
|
||||
<page string="关联流程">
|
||||
<field name="soong_record_ids" style="width:100%%; margin-top: 10px;">
|
||||
<tree edit="true" delete="true" editable="bottom" action="open_record" type="object">
|
||||
<tree edit="true" delete="true" editable="bottom" type="object">
|
||||
<field name="code"/>
|
||||
<field name="workflow_record_id" domain="[('users_ids', 'in', uid)]" options="{'no_open': True}"/>
|
||||
<field name="approvals_group_id"/>
|
||||
<field name="create_uid"/>
|
||||
<field name="write_date2"/>
|
||||
<button name="open_record" type="object" string="详情" class="btn-primary"/>
|
||||
<button name="unlink" type="object" string="删除" class="btn-primary"/>
|
||||
<button name="open_record" type="object" string="详情" class="btn-primary"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
|
||||
@@ -16,8 +16,7 @@ class SoongBouncedWizard(models.Model):
|
||||
if log_ids[-1].approval_state == '2':
|
||||
raise UserError('当前状态不可以收回')
|
||||
employee_id = self.env.user.employee_id.id
|
||||
self.env['soong.workflow.record'].search([('code', '=', self.code)]).write(
|
||||
{'employee_ids': [(6, 0, [employee_id])]})
|
||||
self.env['soong.workflow.record'].search([('code', '=', self.code)]).write({'employee_ids': [(6, 0, [employee_id])]})
|
||||
log_ids[-1].unlink()
|
||||
log_ids[-2].write({'approval_state': '1'})
|
||||
record.write({'state': log_ids[-2].name})
|
||||
@@ -26,8 +26,7 @@ class YuthonNotice(models.Model):
|
||||
department_ids = fields.Many2many('hr.department', string='部门范围')
|
||||
users_role_ids = fields.Many2many('soong.user.role', string='角色范围')
|
||||
users_role_group_ids = fields.Many2many('soong.user.role.group', string='角色组')
|
||||
notice_state = fields.Selection([('no', '未发布'), ('yes', '已发布'), ('stop', '已终止')], default='no',
|
||||
string="公告状态")
|
||||
notice_state = fields.Selection([('no', '未发布'), ('yes', '已发布'), ('stop', '已终止')], default='no', string="公告状态")
|
||||
notice_documents_ids = fields.Many2many('ir.attachment', string="附件")
|
||||
is_notice_roger = fields.Selection([('yes', '已读'), ('no', '未读')], default='no', string="确认状态")
|
||||
is_change_notice = fields.Boolean(string="是否发送通知", default=True)
|
||||
@@ -45,7 +44,7 @@ class YuthonNotice(models.Model):
|
||||
@api.model_create_multi
|
||||
def create(self, vals_list):
|
||||
for i in vals_list:
|
||||
if i['department_ids'] == i['employee_ids'] == i['users_role_ids']:
|
||||
if i['department_ids'] == i['employee_ids'] == i['users_role_ids'] == i['users_role_group_ids']:
|
||||
raise UserError('请填写发布的范围')
|
||||
return super().create(vals_list)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
decoration-muted="notice_state == 'stop'">
|
||||
<field name="name" required="1"/>
|
||||
<field name="notice_type_id" string="类型" class="list_ids_width"/>
|
||||
<field name="users_id" string="发布人" widget="ztree_select" class="list_ids_width"/>
|
||||
<field name="users_id" string="发布人" class="list_ids_width"/>
|
||||
<field name="department_id" column_invisible="1"/>
|
||||
<field name="users_ids" column_invisible="1"/>
|
||||
<field name="create_date1"/>
|
||||
@@ -53,10 +53,10 @@
|
||||
</div>
|
||||
<group col="4">
|
||||
<group>
|
||||
<field name="notice_type_id" required="1"/>
|
||||
<field name="notice_type_id"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="users_id" required="1" widget="ztree_select"/>
|
||||
<field name="users_id"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="work_end" invisible="1"/>
|
||||
@@ -110,7 +110,7 @@
|
||||
js_class="custom_notice_tree_button">
|
||||
<field name="name"/>
|
||||
<field name="notice_type_id" string="类型"/>
|
||||
<field name="users_id" string="发布人" widget="ztree_select" class="list_ids_width"/>
|
||||
<field name="users_id" string="发布人" class="list_ids_width"/>
|
||||
<field name="is_notice_roger"/>
|
||||
<field name="department_id" column_invisible="1"/>
|
||||
<field name="users_ids" column_invisible="1"/>
|
||||
@@ -128,10 +128,10 @@
|
||||
<form create="false" edit="false" delete="false" string="公告管理">
|
||||
<group col="4">
|
||||
<group>
|
||||
<field name="notice_type_id" required="1" string="发布类型"/>
|
||||
<field name="notice_type_id" string="发布类型"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="users_id" required="1" widget="ztree_select"/>
|
||||
<field name="users_id"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="read_number"/>
|
||||
|
||||
Reference in New Issue
Block a user