# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import models, fields, api, exceptions, _ class PropertyAssess(models.Model): _name = 'property.assess' _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_assess_code')) property_documents_ids = fields.Many2many('documents.document', string="评估文件") property_assess_line_ids = fields.One2many('property.assess.line', 'property_assess_id', string="评估文件") class PropertyAssessLine(models.Model): _name = 'property.assess.line' property_assess_id = fields.Many2one('property.assess', string='关联审批') product_id = fields.Many2one('product.product', string="待评估物业") partner_id = fields.Many2one('res.partner', string="评估公司") assess_type = fields.Selection([('rent_money', '租金'), ('value', '价值')], string="评估类别")