38 lines
1.8 KiB
Python
38 lines
1.8 KiB
Python
from odoo import api, fields, models, tools
|
|
|
|
|
|
class IssueApprovalDecision(models.Model):
|
|
_name = "issue.approval.decision"
|
|
_description = '决策清单'
|
|
_order = 'sequence asc'
|
|
_rec_name = 'specifics'
|
|
|
|
decision_type_id = fields.Many2one('issue.approval.decision.type', string='事项类别')
|
|
sequence = fields.Char(string='序号', store=True)
|
|
specifics = fields.Char(string='具体事项')
|
|
council = fields.Selection([('approval', '审'), ('decide', '决')], string='党总委员会')
|
|
team_meet = fields.Selection([('approval', '审'), ('decide', '决')], string='经营班子会')
|
|
board_meet = fields.Selection([('approval', '审'), ('decide', '决'), ('commission', '授权投决会')], string='董事会')
|
|
district_bureau = fields.Selection([('record', '备案'), ('approved', '核准'), ('record_approved', '备案、核准')], string='上级单位')
|
|
yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'),
|
|
('thlc', '天河粮储'), ('tctj', '天投城建')], string="所属公司")
|
|
department_id = fields.Many2one('hr.department', string="部门")
|
|
start_date = fields.Date(string="生效日期")
|
|
end_date = fields.Date(string="失效日期")
|
|
remarks = fields.Char(string='备注')
|
|
|
|
issue_approval_id = fields.Many2one('issue.approval', string="关联议题审批")
|
|
|
|
@api.onchange('decision_type_id')
|
|
def onchange_sequence(self):
|
|
for seq in self:
|
|
seq.sequence = seq.decision_type_id.sequence
|
|
num = seq.search_count([('decision_type_id', '=', seq.decision_type_id.id)])
|
|
if seq.decision_type_id:
|
|
seq.sequence = seq.sequence + '.' + str(num+1)
|
|
else:
|
|
seq.sequence = ''
|
|
|
|
|
|
|