# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import models, fields, api, exceptions, _ class PropertyManagement(models.Model): _name = 'property.management' _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_management_code')) effective_start_date = fields.Date(string="生效开始日期") effective_end_date = fields.Date(string="生效结束日期") reason_change = fields.Char(string="变更事由") handling_opinions = fields.Text(string="经办意见") original_property_ids = fields.One2many('property.information', 'original_property_id', string="原物业信息") new_property_ids = fields.One2many('property.information.detail.lines', 'new_property_id', string="新物业信息") class PropertyInformationDetailLines(models.Model): _name = 'property.information.detail.lines' _description = '新物业信息' new_property_id = fields.Many2one('property.management', string="新物业信息") new_company = fields.Char(string="新公司") new_admin = fields.Char(string="新管理员") new_precincts = fields.Char(string="新片区") new_management_type = fields.Char(string="新管理类型")