添加功能
This commit is contained in:
@@ -8,4 +8,4 @@ from . import inherit_room_booking
|
||||
from . import issue_approval
|
||||
from . import inherit_hr_employee
|
||||
from . import issue_meeting_minutes
|
||||
from . import inherit_soong_workflow_mixin
|
||||
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
from odoo import api, fields, models, _
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class SoongWorkflowMixin(models.AbstractModel):
|
||||
_inherit = 'soong.workflow.mixin'
|
||||
|
||||
# 上议题
|
||||
def action_meeting(self):
|
||||
if self.is_issues:
|
||||
raise UserError('当前议题已上会,请勿重复提交')
|
||||
self.write({'is_issues': 'Ture'})
|
||||
issue_id = self.env['issue.library'].create({'name': self.name})
|
||||
self.related_issues_id = issue_id.id
|
||||
workflow_record_id = self.env["soong.workflow.record"].search([("res_model", "=", self._name), ("res_id", "=", self.id)])
|
||||
self.env['issue.library.approval.line'].create({
|
||||
'issue_library_id': issue_id.id,
|
||||
'workflow_record_id': workflow_record_id.id,
|
||||
'approval_type': workflow_record_id.workflow_id.id,
|
||||
'code': self.code,
|
||||
'approval_date': fields.Datetime.now(),
|
||||
})
|
||||
@@ -13,7 +13,7 @@ class IssueApprovalDecision(models.Model):
|
||||
specifics = fields.Text(string='具体事项')
|
||||
council = fields.Selection([('approval', '审'), ('decide', '决')], string='党总委员会')
|
||||
team_meet = fields.Selection([('approval', '审'), ('decide', '决')], string='经营班子会')
|
||||
board_meet = fields.Selection([('approval', '审'), ('decide', '决'), ('commission', '授权投决会')], string='董事会')
|
||||
board_meet = fields.Selection([('approval', '审'), ('decide', '决'), ('commission', '授权投决会')], string='董事会', compute='_compute_board_meet')
|
||||
district_bureau = fields.Selection([('record', '备案'), ('approved', '核准'), ('record_approved', '备案、核准')], string='上级单位')
|
||||
yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'),
|
||||
('thlc', '天河粮储'), ('tctj', '天投城建')], string="所属公司")
|
||||
@@ -36,5 +36,9 @@ class IssueApprovalDecision(models.Model):
|
||||
if seq.decision_type_id.decision_type_id:
|
||||
seq.decision_type_on_id = seq.decision_type_id.decision_type_id
|
||||
|
||||
|
||||
@api.depends('board_meet')
|
||||
def _compute_board_meet(self):
|
||||
for record in self:
|
||||
if record.board_meet:
|
||||
record.team_meet = 'approval'
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ class IssueLibrary(models.Model):
|
||||
_rec_name = 'name'
|
||||
|
||||
name = fields.Char(string='议题事项')
|
||||
name_text = fields.Text(string='议题事项')
|
||||
name_text = fields.Text(string='议题事项', compute='_compute_name', readonly=False)
|
||||
code = fields.Char(string='编号', required=True, copy=False,
|
||||
default=lambda self: self.env['ir.sequence'].next_by_code('issue_library_code'))
|
||||
state = fields.Selection([('draft', '待提交'), ('approval', '审批中'), ('on_approval', '已审批'),
|
||||
@@ -155,9 +155,10 @@ class IssueLibrary(models.Model):
|
||||
raise UserError('议题已上会,不能删除')
|
||||
return super().unlink()
|
||||
|
||||
@api.onchange('name')
|
||||
def _onchange_name(self):
|
||||
self.name_text = self.name
|
||||
@api.depends('name')
|
||||
def _compute_name(self):
|
||||
for record in self:
|
||||
record.name_text = record.name
|
||||
|
||||
@api.onchange('issue_library_room_line_ids')
|
||||
def _onchange_issue_library_room_line_ids(self):
|
||||
|
||||
@@ -52,7 +52,6 @@
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="yuthon_company" invisible="1"/>
|
||||
<field name="users_role_ids" invisible="1" widget="many2many_tags"/>
|
||||
<field name="is_booking"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="4">
|
||||
@@ -103,7 +102,7 @@
|
||||
<group/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="关联会议" invisible="is_booking == False">
|
||||
<page string="关联会议">
|
||||
<field name="issue_library_room_line_ids">
|
||||
<tree>
|
||||
<field name="issue_library_id" column_invisible="1"/>
|
||||
@@ -171,7 +170,6 @@
|
||||
<field name="cs_party" invisible="1"/>
|
||||
<field name="cs_class" invisible="1"/>
|
||||
<field name="cs_boss" invisible="1"/>
|
||||
<field name="is_booking"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="4">
|
||||
@@ -222,7 +220,7 @@
|
||||
<group/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="关联会议" invisible="is_booking == False">
|
||||
<page string="关联会议">
|
||||
<field name="issue_library_room_line_ids" readonly="1">
|
||||
<tree>
|
||||
<field name="issue_library_id" column_invisible="1"/>
|
||||
@@ -344,7 +342,6 @@
|
||||
<field name="cs_party" invisible="1"/>
|
||||
<field name="cs_class" invisible="1"/>
|
||||
<field name="cs_boss" invisible="1"/>
|
||||
<field name="is_booking" invisible="1"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="2">
|
||||
@@ -387,7 +384,7 @@
|
||||
<group/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="关联会议" invisible="is_booking == False">
|
||||
<page string="关联会议">
|
||||
<field name="issue_library_room_line_ids" readonly="1">
|
||||
<tree>
|
||||
<field name="issue_library_id" column_invisible="1"/>
|
||||
@@ -452,7 +449,6 @@
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="yuthon_company" invisible="1"/>
|
||||
<field name="users_role_ids" invisible="1" widget="many2many_tags"/>
|
||||
<field name="is_booking"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="4">
|
||||
@@ -503,7 +499,7 @@
|
||||
<group/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="关联会议" invisible="is_booking == False">
|
||||
<page string="关联会议">
|
||||
<field name="issue_library_room_line_ids">
|
||||
<tree>
|
||||
<field name="issue_library_id" column_invisible="1"/>
|
||||
@@ -560,8 +556,6 @@
|
||||
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_issue.view_issue_library_tree3')}),
|
||||
(0, 0, {'view_mode': 'form', 'view_id': ref('yuthon_issue.view_issue_library_form3')})]"/>
|
||||
</record>
|
||||
|
||||
|
||||
<!--班子会议题菜单-->
|
||||
<record id="view_issue_library_tree4" model="ir.ui.view">
|
||||
<field name="name">issue.library.tree</field>
|
||||
@@ -607,7 +601,6 @@
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="yuthon_company" invisible="1"/>
|
||||
<field name="users_role_ids" invisible="1" widget="many2many_tags"/>
|
||||
<field name="is_booking"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="2">
|
||||
@@ -650,7 +643,7 @@
|
||||
<group/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="关联会议" invisible="is_booking == False">
|
||||
<page string="关联会议">
|
||||
<field name="issue_library_room_line_ids" readonly="1">
|
||||
<tree>
|
||||
<field name="issue_library_id" column_invisible="1"/>
|
||||
@@ -715,7 +708,6 @@
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="yuthon_company" invisible="1"/>
|
||||
<field name="users_role_ids" invisible="1" widget="many2many_tags"/>
|
||||
<field name="is_booking"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="4">
|
||||
@@ -766,7 +758,7 @@
|
||||
<group/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="关联会议" invisible="is_booking == False">
|
||||
<page string="关联会议">
|
||||
<field name="issue_library_room_line_ids">
|
||||
<tree>
|
||||
<field name="issue_library_id" column_invisible="1"/>
|
||||
@@ -868,7 +860,6 @@
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="yuthon_company" invisible="1"/>
|
||||
<field name="users_role_ids" invisible="1" widget="many2many_tags"/>
|
||||
<field name="is_booking"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="2">
|
||||
@@ -911,7 +902,7 @@
|
||||
<group/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="关联会议" invisible="is_booking == False">
|
||||
<page string="关联会议">
|
||||
<field name="issue_library_room_line_ids" readonly="1">
|
||||
<tree>
|
||||
<field name="issue_library_id" column_invisible="1"/>
|
||||
@@ -987,7 +978,6 @@
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="yuthon_company" invisible="1"/>
|
||||
<field name="users_role_ids" invisible="1" widget="many2many_tags"/>
|
||||
<field name="is_booking"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="4">
|
||||
@@ -1038,7 +1028,7 @@
|
||||
<group/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="关联会议" invisible="is_booking == False">
|
||||
<page string="关联会议">
|
||||
<field name="issue_library_room_line_ids">
|
||||
<tree>
|
||||
<field name="issue_library_id" column_invisible="1"/>
|
||||
@@ -1128,7 +1118,6 @@
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="yuthon_company" invisible="1"/>
|
||||
<field name="users_role_ids" invisible="1" widget="many2many_tags"/>
|
||||
<field name="is_booking"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="2">
|
||||
@@ -1155,8 +1144,8 @@
|
||||
<field name="issue_library_approval_line_ids" readonly="1">
|
||||
<tree>
|
||||
<field name="issue_library_id" column_invisible="1"/>
|
||||
<field name="workflow_record_id" string="标题"/>
|
||||
<field name="code"/>
|
||||
<field name="workflow_record_id" string="标题"/>
|
||||
<field name="approval_type"/>
|
||||
<field name="approval_date"/>
|
||||
<button name="open_record" type="object" string="详情" class="btn-primary"/>
|
||||
@@ -1171,7 +1160,7 @@
|
||||
<group/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="关联会议" invisible="is_booking == False">
|
||||
<page string="关联会议">
|
||||
<field name="issue_library_room_line_ids" readonly="1">
|
||||
<tree>
|
||||
<field name="issue_library_id" column_invisible="1"/>
|
||||
@@ -1236,7 +1225,6 @@
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="yuthon_company" invisible="1"/>
|
||||
<field name="users_role_ids" invisible="1" widget="many2many_tags"/>
|
||||
<field name="is_booking"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="4">
|
||||
@@ -1287,7 +1275,7 @@
|
||||
<group/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="关联会议" invisible="is_booking == False">
|
||||
<page string="关联会议">
|
||||
<field name="issue_library_room_line_ids">
|
||||
<tree>
|
||||
<field name="issue_library_id" column_invisible="1"/>
|
||||
@@ -1388,7 +1376,6 @@
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="yuthon_company" invisible="1"/>
|
||||
<field name="users_role_ids" invisible="1" widget="many2many_tags"/>
|
||||
<field name="is_booking"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="2">
|
||||
@@ -1431,7 +1418,7 @@
|
||||
<group/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="关联会议" invisible="is_booking == False">
|
||||
<page string="关联会议">
|
||||
<field name="issue_library_room_line_ids" readonly="1">
|
||||
<tree>
|
||||
<field name="issue_library_id" column_invisible="1"/>
|
||||
@@ -1496,7 +1483,6 @@
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="yuthon_company" invisible="1"/>
|
||||
<field name="users_role_ids" invisible="1" widget="many2many_tags"/>
|
||||
<field name="is_booking"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="4">
|
||||
@@ -1547,7 +1533,7 @@
|
||||
<group/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="关联会议" invisible="is_booking == False">
|
||||
<page string="关联会议">
|
||||
<field name="issue_library_room_line_ids">
|
||||
<tree>
|
||||
<field name="issue_library_id" column_invisible="1"/>
|
||||
@@ -1648,7 +1634,6 @@
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="yuthon_company" invisible="1"/>
|
||||
<field name="users_role_ids" invisible="1" widget="many2many_tags"/>
|
||||
<field name="is_booking"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="2">
|
||||
@@ -1691,7 +1676,7 @@
|
||||
<group/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="关联会议" invisible="is_booking == False">
|
||||
<page string="关联会议">
|
||||
<field name="issue_library_room_line_ids" readonly="1">
|
||||
<tree>
|
||||
<field name="issue_library_id" column_invisible="1"/>
|
||||
@@ -1767,7 +1752,6 @@
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="yuthon_company" invisible="1"/>
|
||||
<field name="users_role_ids" invisible="1" widget="many2many_tags"/>
|
||||
<field name="is_booking"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="4">
|
||||
@@ -1818,7 +1802,7 @@
|
||||
<group/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="关联会议" invisible="is_booking == False">
|
||||
<page string="关联会议">
|
||||
<field name="issue_library_room_line_ids">
|
||||
<tree>
|
||||
<field name="issue_library_id" column_invisible="1"/>
|
||||
@@ -1908,7 +1892,6 @@
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="yuthon_company" invisible="1"/>
|
||||
<field name="users_role_ids" invisible="1" widget="many2many_tags"/>
|
||||
<field name="is_booking"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="2">
|
||||
@@ -1951,7 +1934,7 @@
|
||||
<group/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="关联会议" invisible="is_booking == False">
|
||||
<page string="关联会议">
|
||||
<field name="issue_library_room_line_ids" readonly="1">
|
||||
<tree>
|
||||
<field name="issue_library_id" column_invisible="1"/>
|
||||
@@ -2027,7 +2010,6 @@
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="yuthon_company" invisible="1"/>
|
||||
<field name="users_role_ids" invisible="1" widget="many2many_tags"/>
|
||||
<field name="is_booking"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="4">
|
||||
@@ -2078,7 +2060,7 @@
|
||||
<group/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="关联会议" invisible="is_booking == False">
|
||||
<page string="关联会议">
|
||||
<field name="issue_library_room_line_ids">
|
||||
<tree>
|
||||
<field name="issue_library_id" column_invisible="1"/>
|
||||
@@ -2175,7 +2157,6 @@
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="yuthon_company" invisible="1"/>
|
||||
<field name="users_role_ids" invisible="1" widget="many2many_tags"/>
|
||||
<field name="is_booking"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="3">
|
||||
@@ -2222,7 +2203,7 @@
|
||||
<group/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="关联会议" invisible="is_booking == False">
|
||||
<page string="关联会议">
|
||||
<field name="issue_library_room_line_ids" readonly="1">
|
||||
<tree>
|
||||
<field name="issue_library_id" column_invisible="1"/>
|
||||
@@ -2287,7 +2268,6 @@
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="yuthon_company" invisible="1"/>
|
||||
<field name="users_role_ids" invisible="1" widget="many2many_tags"/>
|
||||
<field name="is_booking"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="4">
|
||||
@@ -2338,7 +2318,7 @@
|
||||
<group/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="关联会议" invisible="is_booking == False">
|
||||
<page string="关联会议">
|
||||
<field name="issue_library_room_line_ids">
|
||||
<tree>
|
||||
<field name="issue_library_id" column_invisible="1"/>
|
||||
@@ -2454,7 +2434,6 @@
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="yuthon_company" invisible="1"/>
|
||||
<field name="users_role_ids" invisible="1" widget="many2many_tags"/>
|
||||
<field name="is_booking"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="3">
|
||||
@@ -2502,7 +2481,7 @@
|
||||
<group/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="关联会议" invisible="is_booking == False">
|
||||
<page string="关联会议">
|
||||
<field name="issue_library_room_line_ids" readonly="1">
|
||||
<tree>
|
||||
<field name="issue_library_id" column_invisible="1"/>
|
||||
@@ -2567,7 +2546,6 @@
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="yuthon_company" invisible="1"/>
|
||||
<field name="users_role_ids" invisible="1" widget="many2many_tags"/>
|
||||
<field name="is_booking"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="4">
|
||||
@@ -2618,7 +2596,7 @@
|
||||
<group/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="关联会议" invisible="is_booking == False">
|
||||
<page string="关联会议">
|
||||
<field name="issue_library_room_line_ids">
|
||||
<tree>
|
||||
<field name="issue_library_id" column_invisible="1"/>
|
||||
|
||||
Reference in New Issue
Block a user