@@ -6,9 +6,10 @@ class IssueApprovalDecision(models.Model):
|
||||
_name = "issue.approval.decision"
|
||||
_description = '决策清单'
|
||||
_order = 'sequence asc'
|
||||
_rec_name = 'specifics'
|
||||
|
||||
decision_type_id = fields.Many2one('issue.approval.decision.type', string='事项类别')
|
||||
sequence = fields.Char(related='decision_type_id.sequence', string='序号', store=True)
|
||||
sequence = fields.Char(string='序号', store=True)
|
||||
# decision_id = fields.Many2one('issue.approval.decision', string='上级事项')
|
||||
# child_ids = fields.One2many('issue.approval.decision', 'decision_id', string='下级事项')
|
||||
specifics = fields.Char(string='具体事项')
|
||||
@@ -23,6 +24,17 @@ class IssueApprovalDecision(models.Model):
|
||||
end_date = fields.Date(string="失效日期")
|
||||
remarks = fields.Char(string='备注')
|
||||
|
||||
@api.onchange('decision_type_id')
|
||||
def onchange_sequence(self):
|
||||
for seq in self:
|
||||
seq.sequence = seq.decision_type_id.sequence
|
||||
num = seq.search_count([('decision_type_id', '=', seq.decision_type_id.id)])
|
||||
if seq.decision_type_id:
|
||||
seq.sequence = seq.sequence + '.' + str(num+1)
|
||||
else:
|
||||
seq.sequence = ''
|
||||
|
||||
|
||||
# @api.onchange('sequence', 'decision_id')
|
||||
# def _onchange_department_code(self):
|
||||
# for code in self:
|
||||
|
||||
@@ -4,18 +4,20 @@ from odoo.exceptions import ValidationError
|
||||
|
||||
class IssueApprovalDecisionType(models.Model):
|
||||
_name = "issue.approval.decision.type"
|
||||
_description = '决策清单事项类别配置'
|
||||
_order = 'sequence asc'
|
||||
_description = '事项类别配置'
|
||||
_order = 'ase_sequence asc'
|
||||
_rec_name = 'name'
|
||||
|
||||
name = fields.Char(string="名称")
|
||||
name = fields.Char(string="事项类别")
|
||||
sequence = fields.Char(string='序号', store=True)
|
||||
decision_type_id = fields.Many2one('issue.approval.decision.type', string='上级事项')
|
||||
ase_sequence = fields.Integer(string="排序")
|
||||
decision_type_id = fields.Many2one('issue.approval.decision.type', string='上级事项类别')
|
||||
child_ids = fields.One2many('issue.approval.decision.type', 'decision_type_id', string='下级事项')
|
||||
|
||||
@api.onchange('sequence', 'decision_type_id')
|
||||
def _onchange_department_code(self):
|
||||
for code in self:
|
||||
code.ase_sequence = int(code.sequence)
|
||||
if code.sequence and code.decision_type_id:
|
||||
code.sequence = code.decision_type_id.sequence + ('.' + code.sequence if code.sequence else '')
|
||||
else:
|
||||
|
||||
@@ -4,10 +4,11 @@
|
||||
<field name="name">issue.approval.decision.type.tree</field>
|
||||
<field name="model">issue.approval.decision.type</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="决策清单层级配置">
|
||||
<tree string="事项类别配置">
|
||||
<field name="sequence"/>
|
||||
<field name="name"/>
|
||||
<field name="decision_type_id"/>
|
||||
<field name="ase_sequence" column_invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -16,7 +17,7 @@
|
||||
<field name="name">issue.approval.decision.type.form</field>
|
||||
<field name="model">issue.approval.decision.type</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="决策清单层级配置">
|
||||
<form string="事项类别配置">
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<label for="name"/>
|
||||
@@ -37,9 +38,25 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="issue_approval_decision_type_search" model="ir.ui.view">
|
||||
<field name="name">issue.approval.decision.type.search</field>
|
||||
<field name="model">issue.approval.decision.type</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<searchpanel>
|
||||
<field name="decision_type_id"/>
|
||||
</searchpanel>
|
||||
<group expand="0">
|
||||
<filter name="decision_type_id" string="意见类型" context="{'group_by': 'decision_type_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="issue_approval_decision_type_action" model="ir.actions.act_window">
|
||||
<field name="name">决策清单层级配置</field>
|
||||
<field name="name">事项类别配置</field>
|
||||
<field name="res_model">issue.approval.decision.type</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="context">{'search_default_decision_type_id': True,}</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<tree string="决策清单">
|
||||
<field name="sequence"/>
|
||||
<field name="decision_type_id"/>
|
||||
<!-- <field name="decision_id"/>-->
|
||||
<!-- <field name="decision_id"/>-->
|
||||
<field name="specifics"/>
|
||||
<field name="council"/>
|
||||
<field name="team_meet"/>
|
||||
@@ -36,9 +36,9 @@
|
||||
</div>
|
||||
<group col="2">
|
||||
<group>
|
||||
<!-- <field name="decision_id"/>-->
|
||||
<!-- <field name="child_ids" force_save="1" invisible="1"/>-->
|
||||
<field name="sequence"/>
|
||||
<!-- <field name="decision_id"/>-->
|
||||
<!-- <field name="child_ids" force_save="1" invisible="1"/>-->
|
||||
<field name="sequence" force_save="1"/>
|
||||
<field name="council"/>
|
||||
</group>
|
||||
<group>
|
||||
@@ -64,6 +64,18 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="issue_approval_decision_search" model="ir.ui.view">
|
||||
<field name="name">issue.approval.decision.search</field>
|
||||
<field name="model">issue.approval.decision</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<searchpanel>
|
||||
<field name="decision_type_id"/>
|
||||
</searchpanel>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="issue_approval_decision_action" model="ir.actions.act_window">
|
||||
<field name="name">决策清单</field>
|
||||
<field name="res_model">issue.approval.decision</field>
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
sequence="50"/>
|
||||
<menuitem id="issue_approval_decision_type_menu"
|
||||
parent="issue_approval_decision_setting_menu"
|
||||
name="决策清单层级配置"
|
||||
name="事项类别配置"
|
||||
action="issue_approval_decision_type_action"
|
||||
sequence="1"/>
|
||||
</odoo>
|
||||
@@ -209,7 +209,7 @@
|
||||
sequence="9"/>
|
||||
<menuitem id="issue_approval_decision_type_menu_board"
|
||||
parent="issue_approval_decision_setting_menu_board"
|
||||
name="决策清单层级配置"
|
||||
name="事项类别配置"
|
||||
action="yuthon_issue.issue_approval_decision_type_action"
|
||||
sequence="1"/>
|
||||
<!-- 会议室 -->
|
||||
|
||||
Reference in New Issue
Block a user