36 lines
2.1 KiB
Python
36 lines
2.1 KiB
Python
# -*- coding: utf-8 -*-
|
|
from odoo import api, fields, models, tools
|
|
from odoo.exceptions import ValidationError, UserError
|
|
|
|
|
|
class YuthonOfficialLabor(models.Model):
|
|
_name = 'yuthon.official.labor'
|
|
_description = '工会发文'
|
|
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin', 'soong.workflow.mixin']
|
|
_rec_name = 'name'
|
|
|
|
name = fields.Char(string="名称")
|
|
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('official_code'))
|
|
official_type_id = fields.Many2one('official.type', string="公文种类")
|
|
# official_type = fields.Selection([('go', '发文'), ('come', '收文')], string="公文类型")
|
|
reference_cold = fields.Integer(string="公文字号")
|
|
major_event_category = fields.Integer(string="重大事项所属类别")
|
|
# official_partner_id = fields.Many2one('official.partner', string="来文单位")
|
|
remarks = fields.Char(string="备注事项")
|
|
main_text = fields.Html(string='正文')
|
|
# come_file_id = fields.Char(string="来文编号")
|
|
# incoming_file_id = fields.Char(string="收文编号")
|
|
main_flats = fields.Char(string="主送")
|
|
copy_flats = fields.Char(string="抄送")
|
|
servings_number = fields.Integer(string="份数")
|
|
# urgency = fields.Selection([('normal', '一般'), ('urgent', '紧急'), ('extra_urgent', '特急')], string="紧急程度")
|
|
# secret_level = fields.Selection([('normal', '一般'), ('urgent', '秘密'), ('secret', '机密'), ('so_secret', '绝密')],
|
|
# string="密级")
|
|
date = fields.Datetime(string="日期", default=fields.Datetime.now)
|
|
department_id = fields.Many2one('hr.department', string="申请人部门")
|
|
statu = fields.Selection([('drft', '草稿'), ('going', '执行中'), ('cancel', '已取消'), ('done', '已完成')],
|
|
string="状态", default='drft')
|
|
deadline = fields.Date(string="办理期限")
|
|
red_suit = fields.Char(string="套红")
|
|
official_documents_ids = fields.Many2many('documents.document', string="公文相关文件")
|