31 lines
1.3 KiB
Python
31 lines
1.3 KiB
Python
from odoo import api, fields, models, tools
|
|
from odoo.exceptions import ValidationError
|
|
|
|
|
|
|
|
class IssueApprovalDecision(models.Model):
|
|
_name = "issue.approval.decision"
|
|
_description = '决策清单'
|
|
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin']
|
|
_order = 'ordinal asc'
|
|
|
|
name = fields.Char(string='事项')
|
|
ordinal = fields.Char(string='序号', store=True)
|
|
category_matter = fields.Many2one('issue.approval.decision',string='上级事项')
|
|
child_ids = fields.One2many('issue.approval.decision', 'category_matter', string='下级事项')
|
|
specifics = fields.Char(string='具体事项')
|
|
council = fields.Selection([('1','审'), ('2','决')], string='党总委员会')
|
|
team_meet = fields.Selection([('1','审'), ('2','决')], string='经营班子会')
|
|
board_meet = fields.Selection([('1','审'), ('2','决'), ('4','授权投决会')], string='董事会')
|
|
district_bureau = fields.Char(string='区政府、区财政局')
|
|
remarks = fields.Char(string='备注')
|
|
|
|
|
|
@api.onchange('ordinal', 'category_matter')
|
|
def _onchange_department_code(self):
|
|
for code in self:
|
|
if code.category_matter.ordinal:
|
|
code.ordinal = code.category_matter.ordinal +'.'+ code.ordinal if code.ordinal else ''
|
|
else:
|
|
code.ordinal = code.ordinal
|