35 lines
1.3 KiB
Python
35 lines
1.3 KiB
Python
# -*- coding: utf-8 -*-
|
|
|
|
from odoo import models, fields, api
|
|
|
|
|
|
class TxInnovationCompetitionApplication(models.Model):
|
|
_name = 'tx.innovation.competition.application'
|
|
_inherit = ['mail.thread', 'mail.activity.mixin']
|
|
_description = '创新大赛申请'
|
|
|
|
join_type = fields.Selection([("enterprise", "企业"), ("individual", "个人")], string="申报方式", default="enterprise", tracking=True)
|
|
project_name = fields.Char(string='项目名称', tracking=True)
|
|
race_track = fields.Char(string="申报赛道", tracking=True)
|
|
name = fields.Char(string="申报企业或个人名称", tracking=True)
|
|
project_person = fields.Char(string="项目负责人", tracking=True)
|
|
mobile = fields.Char(string="联系方式", tracking=True)
|
|
email = fields.Char(string="电子邮件", tracking=True)
|
|
state = fields.Selection([
|
|
("draft", "草稿"),
|
|
("approve", "待审核"),
|
|
("pass", "通过"),
|
|
("reject", "驳回")], string="状态", default="draft", tracking=True)
|
|
|
|
def action_draft(self):
|
|
self.write({"state": "draft"})
|
|
|
|
def action_approve(self):
|
|
self.write({"state": "approve"})
|
|
|
|
def action_pass(self):
|
|
self.write({"state": "pass"})
|
|
|
|
def action_reject(self):
|
|
self.write({"state": "reject"})
|