Files
gzth/yuthon_property_approval/models/property_fitment.py
T
2025-08-04 14:48:59 +08:00

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, _
class PropertyFitment(models.Model):
_name = 'property.fitment'
_description = '装修审批'
_inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin']
_rec_name = 'name'
name = fields.Char(string='标题')
code = fields.Char(string="编号",
default=lambda self: self.env['ir.sequence'].next_by_code('property_fitment_code'))
address = fields.Text(string="物业地址")
lessee = fields.Char(string="承租方")
contact = fields.Char(string="联系人")
phone = fields.Char(string="联系电话")
renovation_projects = fields.Char(string="装修项目")
construction_unit = fields.Char(string="施工单位")
leader = fields.Char(string="负责人")
phone_number = fields.Char(string="联系电话")
start_date = fields.Date(string="装修开始日期")
end_date = fields.Date(string="装修结束日期")
renovation_deposit = fields.Float(string="装修押金")
#附件
card_id = fields.Many2one('documents.document', string="身份证")
license_id = fields.Many2one('documents.document', string="营业执照")
property_documents_ids = fields.Many2many('documents.document', string="装修文件")
urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度',
default='normal')
active = fields.Boolean('Active', default=True, tracking=True)
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])])