31 lines
1.5 KiB
Python
31 lines
1.5 KiB
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo import models, fields
|
|
|
|
|
|
class PropertyCheckoutInspectionItem(models.Model):
|
|
"""退租检查项字典(物业检查项明细行的「检查项」many2one 来源)"""
|
|
_name = 'property.checkout.inspection.item'
|
|
_description = '退租检查项'
|
|
_order = 'sequence, id'
|
|
|
|
name = fields.Char(string='检查项名称', required=True)
|
|
sequence = fields.Integer(string='序号', default=10)
|
|
active = fields.Boolean(string='有效', default=True)
|
|
|
|
|
|
class PropertyTenantCheckoutInspection(models.Model):
|
|
"""租户退租表-物业检查项(工程组检查阶段的可增删明细行)"""
|
|
_name = 'property.tenant.checkout.inspection'
|
|
_description = '租户退租表-物业检查项'
|
|
_order = 'sequence, id'
|
|
|
|
checkout_id = fields.Many2one('property.tenant.checkout', string='退租表', ondelete='cascade') # 关联退租表
|
|
sequence = fields.Integer(string='序号', default=10) # 排序
|
|
item_id = fields.Many2one('property.checkout.inspection.item', string='检查项') # 检查项(字典)
|
|
item_name = fields.Char(related='item_id.name', string='检查项名称') # 冗余名称(报表展示用)
|
|
status = fields.Selection([('normal', '正常'), ('abnormal', '异常')], string='状态', default='normal') # 正常/异常
|
|
note = fields.Text(string='批注') # 批注说明
|
|
repair_fee = fields.Float(string='维修费') # 维修费金额
|