From eb8b4a1a5c76988380c7107ceaea6f615d264b45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Thu, 13 Nov 2025 09:34:37 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/yuthon_retired_approval_views.xml | 2 +- .../models/inherit_yuthon_property.py | 3 +-- .../views/inherit_yuthon_property_views.xml | 3 ++- .../wizard/property_rental_wizard.py | 4 ++-- yuthon_trade/models/yuthon_task_approval.py | 13 +++++++++++++ yuthon_trade/views/yuthon_task_approval_views.xml | 3 ++- 6 files changed, 21 insertions(+), 7 deletions(-) diff --git a/yuthon_hr_employee_approval/views/yuthon_retired_approval_views.xml b/yuthon_hr_employee_approval/views/yuthon_retired_approval_views.xml index 9a27fcc39..edfa4a8b3 100644 --- a/yuthon_hr_employee_approval/views/yuthon_retired_approval_views.xml +++ b/yuthon_hr_employee_approval/views/yuthon_retired_approval_views.xml @@ -55,7 +55,7 @@ - + diff --git a/yuthon_property_approval/models/inherit_yuthon_property.py b/yuthon_property_approval/models/inherit_yuthon_property.py index 5469b6d9d..921571586 100644 --- a/yuthon_property_approval/models/inherit_yuthon_property.py +++ b/yuthon_property_approval/models/inherit_yuthon_property.py @@ -996,8 +996,7 @@ class PropertyRentList(models.Model): contract_id = fields.Many2one('property.lease.contract', string="关联租赁合同审批") tenure_type = fields.Selection(related='contract_id.tenure_type', string="权属类型", store=True) property_address = fields.Text(string="物业信息", compute='get_property_address') - contract_sort = fields.Selection(related='contract_id.contract_sort', string="资产类型", store=True) # 数据库存储问题,无意义 - contract_sort1 = fields.Selection([('property', '物业'), ('guanggao', '广告位'), ('parking', '停车场'), ('guanzi', '管子间'), ('room', '机房'), ('base_station','基站'), ('other', '其他')], string="资产类型", default='property') + contract_sort = fields.Selection(related='contract_id.contract_sort', string="资产类型", store=True) company_id = fields.Many2one(related='contract_id.lessor_id', string="出租方公司", store=True) @api.depends('contract_id') diff --git a/yuthon_property_approval/views/inherit_yuthon_property_views.xml b/yuthon_property_approval/views/inherit_yuthon_property_views.xml index 2d1905de7..8fcb720fa 100644 --- a/yuthon_property_approval/views/inherit_yuthon_property_views.xml +++ b/yuthon_property_approval/views/inherit_yuthon_property_views.xml @@ -123,7 +123,7 @@ - + @@ -347,6 +347,7 @@ + diff --git a/yuthon_property_approval/wizard/property_rental_wizard.py b/yuthon_property_approval/wizard/property_rental_wizard.py index 9136a3b4c..9d5196a56 100644 --- a/yuthon_property_approval/wizard/property_rental_wizard.py +++ b/yuthon_property_approval/wizard/property_rental_wizard.py @@ -53,7 +53,7 @@ class PropertyRentalWizard(models.Model): "contract_id": record.id, "due_date": start_date, 'multiplier': multiplier, - "contract_sort1": record.contract_sort, + "contract_sort": record.contract_sort, 'acc_type': acc_type, "lessee_id": record.lessee_id.id, "property_id": property_id, @@ -66,7 +66,7 @@ class PropertyRentalWizard(models.Model): "contract_id": record.id, "due_date": start_date, 'multiplier': multiplier, - "contract_sort1": record.contract_sort, + "contract_sort": record.contract_sort, "lessee_id": record.lessee_id.id, 'acc_type': acc_type, "property_id": property_id, diff --git a/yuthon_trade/models/yuthon_task_approval.py b/yuthon_trade/models/yuthon_task_approval.py index 22e07df58..aeaaed93f 100644 --- a/yuthon_trade/models/yuthon_task_approval.py +++ b/yuthon_trade/models/yuthon_task_approval.py @@ -29,12 +29,25 @@ class YuthonTaskApproval(models.Model): duration = fields.Float(string="时长", store=True, compute='_compute_duration') concentration = fields.Float( string="浓度") warning_value = fields.Float(string="警戒值") + symbol = fields.Selection([('outweigh', '>'), ('less', '<'), ('equals', '=')], string="符号", compute='_compute_symbol') def _get_default_name_title(self): return self._description if self._description else self._name name_title = fields.Char(default=_get_default_name_title) self_users_ids = fields.Many2many('res.users', string="当前经办人", default=lambda self: [(6, 0, [self.env.user.id])]) + @api.depends('concentration', 'warning_value') + def _compute_symbol(self): + for record in self: + if record.concentration and record.warning_value: + if record.concentration > record.warning_value: + record.symbol = 'outweigh' + elif record.concentration < record.warning_value: + record.symbol = 'less' + else: + record.symbol = 'equals' + + @api.onchange('task_id') def _onchange_task_id(self): if self.task_id: diff --git a/yuthon_trade/views/yuthon_task_approval_views.xml b/yuthon_trade/views/yuthon_task_approval_views.xml index 3dc9612f8..ac8a08876 100644 --- a/yuthon_trade/views/yuthon_task_approval_views.xml +++ b/yuthon_trade/views/yuthon_task_approval_views.xml @@ -66,7 +66,8 @@