From f63066f0b3d8ab970402abdec25e2ff064035bb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Wed, 15 Apr 2026 18:25:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=83=E5=B1=9E=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_property_approval/models/inherit_yuthon_property.py | 7 +++++++ .../views/inherit_yuthon_property_views.xml | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/yuthon_property_approval/models/inherit_yuthon_property.py b/yuthon_property_approval/models/inherit_yuthon_property.py index 6ff0c3f73..f0181a29e 100644 --- a/yuthon_property_approval/models/inherit_yuthon_property.py +++ b/yuthon_property_approval/models/inherit_yuthon_property.py @@ -645,6 +645,7 @@ class PropertyAccountsReceivable(models.Model): related='contract_id.contract_sort', string="资产类型", index=True) admin_id = fields.Many2one(related='contract_id.admin_id', string="片区管理员", store=True) tenure_type = fields.Selection([('self', '自有'), ('agency', '代管')], string='权属类型', compute="compute_tenure_type", store=True) + tenure_type_label = fields.Char(string='权属类型(文本)', compute='_compute_tenure_type_label', store=True) precinct_id = fields.Many2one(related='contract_id.precinct_id', string="所属片区", store=True) penalty = fields.Float(string="违约金基数") penalty_date = fields.Date(string="违约金日期") @@ -786,6 +787,12 @@ class PropertyAccountsReceivable(models.Model): for account in accounts: account.compute_tenure_type() + @api.depends('tenure_type') + def _compute_tenure_type_label(self): + label_map = {'self': '自有', 'agency': '代管'} + for record in self: + record.tenure_type_label = label_map.get(record.tenure_type, '') + def update_charging_range(self): accounts = self.env["property.accounts.receivable"].browse( self._context.get('active_ids', self._context.get('active_id', [])) diff --git a/yuthon_property_approval/views/inherit_yuthon_property_views.xml b/yuthon_property_approval/views/inherit_yuthon_property_views.xml index 07cf5a824..d1f2703b1 100644 --- a/yuthon_property_approval/views/inherit_yuthon_property_views.xml +++ b/yuthon_property_approval/views/inherit_yuthon_property_views.xml @@ -479,11 +479,11 @@ - - + +