69 lines
3.5 KiB
Python
69 lines
3.5 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='议题事项')
|
|
issue_id = fields.Many2one('issue.library', string="上级议题", ondelete='cascade')
|
|
issue_ids = fields.One2many('issue.library', 'issue_id', string='子议题')
|
|
code = fields.Char(string='编号', required=True, copy=False,
|
|
default=lambda self: self.env['ir.sequence'].next_by_code('issue_library_code'))
|
|
statu = fields.Selection([('will', '待上会'), ('done', '已上会'), ('cancel', '已取消')], default='will', string="议题状态")
|
|
is_party = fields.Boolean(string="党之委会")
|
|
is_class = fields.Boolean(string="班子会")
|
|
is_boss = fields.Boolean(string="董事会")
|
|
is_note = fields.Boolean(string="备案、核准")
|
|
creart_datetime = fields.Datetime(string="创建时间", default=fields.Datetime.now)
|
|
first_party = fields.Many2one('res.partner', string='甲方')
|
|
first_b = fields.Many2one('res.partner', string='乙方')
|
|
create_performance = fields.Datetime(string='开始履约日期')
|
|
end_performance = fields.Datetime(string='结束履约日期')
|
|
urgency = fields.Selection([('ordinary', '普通'),
|
|
('normal', '一般'),
|
|
('urgent', '紧急')], string="紧急度")
|
|
employee_person = fields.Many2one('hr.employee', string="联系人")
|
|
account = fields.Char(string="账户")
|
|
bank = fields.Char(string="开户行")
|
|
contract_amount = fields.Float(string="合同金额")
|
|
procurement_method = fields.Selection([('Internal_bidding', '内部竞标简易程序'),
|
|
('web_procurement', '网络采购'),
|
|
('direct_procurement', '直接委托采购'),
|
|
('singleness_procurement', '单一来源采购'),
|
|
('clique_procurement', '集团摇珠采购')], string='采购方式')
|
|
other_conventions = fields.Text(string='其他约定')
|
|
payment_methods_ids = fields.One2many('payment.methods', 'issue_library_id', string='关联付款方式')
|
|
notice_documents_ids = fields.Many2many('documents.document', string="议题管理文件")
|
|
|
|
def issue_cancel(self):
|
|
self.write({"statu": "cancel"})
|
|
|
|
def on_meeting(self):
|
|
self.write({"statu": "done"})
|
|
|
|
def all_meting_issue(self):
|
|
pass
|
|
|
|
|
|
class PaymentMethods(models.Model):
|
|
_name = "payment.methods"
|
|
_description = '付款方式'
|
|
|
|
money = fields.Float(string="金额")
|
|
by_stages = fields.Char(string="分期")
|
|
date = fields.Date(string="日期")
|
|
has_acceptance_material = fields.Selection([('yes', '是'),
|
|
('no', '否')], string="是否需要验收材料")
|
|
main = fields.Text(string="备注")
|
|
payment_methods = fields.Selection([('cash', '现金'),
|
|
('to_the_public', '对公'),
|
|
('wechat', '微信'),
|
|
('alipay', '支付宝'),
|
|
], string="支付方式")
|
|
issue_library_id = fields.Many2one('issue.library', string='关联议题管理')
|