40 lines
1.9 KiB
Python
40 lines
1.9 KiB
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo import models, fields, api, exceptions, _
|
|
from datetime import datetime, timedelta
|
|
|
|
|
|
class PropertyAccountsApproval(models.Model):
|
|
_name = 'property.accounts.approval'
|
|
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin', 'soong.workflow.mixin']
|
|
_description = '生成应收审批单'
|
|
|
|
name = fields.Char(string='名称', required=True)
|
|
code = fields.Char(string="编号",
|
|
default=lambda self: self.env['ir.sequence'].next_by_code(
|
|
'property_claim_approval_code'))
|
|
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
|
|
department_id = fields.Many2one('hr.department', string="部门")
|
|
urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度',
|
|
default='normal')
|
|
reason_application = fields.Html(string="事由")
|
|
documents_ids = fields.Many2many('ir.attachment', string="附件")
|
|
is_issues = fields.Boolean(string="是否上会")
|
|
issues_result = fields.Html(string="会议结果")
|
|
related_issues_id = fields.Many2one('issue.library', string="关联议题")
|
|
active = fields.Boolean('Active', default=True, tracking=True)
|
|
bank_ids = fields.One2many('property.bank.statements', 'accounts_id', string="银行流水明细")
|
|
work_end = fields.Boolean(string="结束")
|
|
|
|
def _get_default_name_title(self):
|
|
return self._description if self._description else self._name
|
|
|
|
name_title = fields.Char(default=_get_default_name_title)
|
|
self_users_ids = fields.Many2many('res.users', string="当前经办人", default=lambda self: [(6, 0, [self.env.user.id])])
|
|
|
|
# 流程结束触发方法
|
|
def put_button(self):
|
|
for record in self:
|
|
record.is_put = True
|