36 lines
2.0 KiB
Python
36 lines
2.0 KiB
Python
# -*- coding: utf-8 -*-
|
|
from odoo import api, fields, models, tools
|
|
from odoo.exceptions import ValidationError
|
|
|
|
|
|
class IssueLibrary(models.Model):
|
|
_name = "issue.library"
|
|
_description = '议题库'
|
|
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin']
|
|
_rec_name = 'name'
|
|
|
|
name = fields.Char(string='议题名称')
|
|
code = fields.Char(string='编号', required=True, copy=False,
|
|
default=lambda self: self.env['ir.sequence'].next_by_code('issue_library_code'))
|
|
type_issue = fields.Selection([('business_report', '业务汇报'), ('project_progress', '项目进展'),
|
|
('hr', '人力资源'), ('account_report', '财务报告')], string="议题类别")
|
|
objective = fields.Char(string='目的')
|
|
employee_ids = fields.Many2many('hr.employee', string='参与人员')
|
|
meeting_et = fields.Datetime(string='会议预计时间')
|
|
issue_creation_time = fields.Datetime(string='议题创建时间', default=lambda self: fields.Datetime.now())
|
|
degree_importance = fields.Selection([('normal', '正常'), ('important', '紧急'), ('very_important', '加急')],
|
|
string="重要程度", default='normal')
|
|
issue_status = fields.Selection([('will_meeting', '待上会'), ('done_meeting', '已上会'),
|
|
('reject', '驳回'), ('cancel', '取消')], string="状态", default="will_meeting")
|
|
issue_approval_type = fields.Selection([('ready_meeting', '党总支'), ('party_branch_committee', '党支委'),
|
|
('management_team', '经营班子'), ('board_directors', '董事会')],
|
|
string="议题审批类型")
|
|
company_id = fields.Many2one('res.company', string='公司', index=True, default=lambda self: self.env.company)
|
|
|
|
def go_meeting_approval(self):
|
|
# 将议题生成审批并且跳转。
|
|
self.write({"issue_status": "done_meeting"})
|
|
|
|
def issue_cancel(self):
|
|
self.write({"issue_status": "cancel"})
|