添加功能

This commit is contained in:
李鹏宇
2025-09-19 10:24:06 +08:00
parent bda1245443
commit 1536ef2e29
4 changed files with 18 additions and 1 deletions
@@ -10,6 +10,8 @@ class PropertyEvaluationPlan(models.Model):
name = fields.Char(string='物业名称')
evaluation_area = fields.Float(string='评估面积(m²)')
property_ids = fields.Many2many('yuthon.property', string='物业')
company_id = fields.Many2one('yuthon.property.company', string='评估公司', compute='_compute_search', store=True)
admin_id = fields.Many2one('res.users', string="管理员", compute='_compute_search', store=True)
assessment_category = fields.Selection([('rent_money', '租金'), ('value', '价值')], string="评估类别", default='rent_money')
owner_id = fields.Many2one('yuthon.owner.message', string="权属人")
registered_id = fields.Many2one('yuthon.purpose.evidence', string='证载用途')
@@ -25,6 +27,13 @@ class PropertyEvaluationPlan(models.Model):
remake = fields.Text(string='备注')
property_state = fields.Selection([('to', '待审批'), ('done', '已审批')], string="状态", default='to')
@api.depends('property_ids')
def _compute_search(self):
for record in self:
if record.property_ids:
record.company_id = record.property_ids[0].company_id.id
record.admin_id = record.property_ids[0].admin_id.id
@api.depends('property_ids')
def compute_lease_form(self):
for record in self:
@@ -36,6 +36,12 @@
<search string="物业评估方案">
<field name="name"/>
<field name="owner_id"/>
<field name="company_id"/>
<field name="admin_id"/>
<group expand="0" string="Group By">
<filter string="公司" name="group_company_id" context="{'group_by': 'company_id'}"/>
<filter string="管理员" name="group_admin_id" context="{'group_by': 'admin_id'}"/>
</group>
</search>
</field>
</record>
@@ -14,6 +14,7 @@ class PropertyTransferApproval(models.Model):
default=lambda self: self.env['ir.sequence'].next_by_code('property_transfer_code'))
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
company_id = fields.Many2one(related='users_id.company_id', string="公司", store=True)
is_issues = fields.Boolean(string='是否上会')
issues_result = fields.Html(string="会议结果")
related_issues_id = fields.Many2one('issue.library', string="关联议题")
@@ -48,7 +48,8 @@
<field name="name"/>
<field name="reason"/>
<field name="issues_result" invisible="is_issues == False"/>
<field name="documents_ids" widget="preview_many2many"/>
<field name="documents_ids" widget="preview_many2many" invisible="1"/>
<field name="company_id" invisible="1"/>
</group>
<group col="2" string="个人信息">
<group>