# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import models, fields, api, exceptions, _ class PropertyRecord(models.Model): _name = 'property.record' _description = '物业备案审批' _inherit = ['mail.thread.main.attachment', 'mail.activity.mixin', 'soong.workflow.mixin'] _rec_name = 'name' name = fields.Char(string='标题') code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('property_record_code')) property_documents_ids = fields.Many2many('documents.document', string="物业备案文件") property_record_line_ids = fields.One2many('property.record.line', 'property_record_id', string="评估文件") class PropertyRecordLine(models.Model): _name = 'property.record.line' property_record_id = fields.Many2one('property.record', string='关联审批') product_id = fields.Many2one('product.product', string="物业") product_code = fields.Char(string="评估编号") partner_id = fields.Many2one('res.partner', string="评估公司") property_statu = fields.Char(string="评估状态") property_type = fields.Selection([('rent_money', '租金'), ('value', '价值')], string="评估类别") property_m2 = fields.Float(string="评估面积")