From 10660a6a5ae1075b8086ad05d9dc135d22f5312a Mon Sep 17 00:00:00 2001 From: pengyuthon Date: Tue, 21 Oct 2025 09:57:06 +0800 Subject: [PATCH] 1 --- yuthon_contract/models/inherit_hr_contract.py | 4 +-- .../views/inherit_hr_contract_views.xml | 36 +++++++++---------- .../models/property_meter_archives.py | 9 ++--- 3 files changed, 20 insertions(+), 29 deletions(-) diff --git a/yuthon_contract/models/inherit_hr_contract.py b/yuthon_contract/models/inherit_hr_contract.py index f5bed2258..3652f990d 100644 --- a/yuthon_contract/models/inherit_hr_contract.py +++ b/yuthon_contract/models/inherit_hr_contract.py @@ -80,9 +80,7 @@ class HrContract(models.Model): contact = fields.Char(related="party_id.contact", string="联系人") phone = fields.Char(related="party_id.phone", string="电话") documents_ids = fields.Many2many("ir.attachment", string="合同附件") - current_contract = fields.Boolean( - string="当前合同", default=True, compute="_compute_current_contract", store=True - ) + current_contract = fields.Boolean(string="当前合同", default=True, compute="_compute_current_contract", store=True) is_company = fields.Boolean( string="本公司", default=True, diff --git a/yuthon_contract/views/inherit_hr_contract_views.xml b/yuthon_contract/views/inherit_hr_contract_views.xml index 4e4d4cd36..13f55e393 100644 --- a/yuthon_contract/views/inherit_hr_contract_views.xml +++ b/yuthon_contract/views/inherit_hr_contract_views.xml @@ -13,7 +13,6 @@ false - "{'no_open': True}" 1 @@ -63,11 +62,10 @@ 1 - false - "{'no_open': True}" + false - + @@ -79,7 +77,7 @@ - + @@ -90,7 +88,7 @@ - + @@ -121,19 +119,19 @@ - - hr.contract.search.inherit - hr.contract - - - - - - - - - - + + + + + + + + + + + + + 批量导入合同 diff --git a/yuthon_property/models/property_meter_archives.py b/yuthon_property/models/property_meter_archives.py index 4849e6615..2ee442fde 100644 --- a/yuthon_property/models/property_meter_archives.py +++ b/yuthon_property/models/property_meter_archives.py @@ -49,14 +49,9 @@ class PropertyMeterArchives(models.Model): def create(self, vals): record = super().create(vals) if "name" in vals and vals["name"]: - existing_records = self.search([ - ("name", "=", vals["name"]), - ("id", "!=", record.id) - ]) + existing_records = self.search([("name", "=", vals["name"]), ("id", "!=", record.id)]) if existing_records: - raise ValidationError( - f"仪表编号 '{vals['name']}' 已存在,请使用其他编号!" - ) + raise ValidationError(f"仪表编号 '{vals['name']}' 已存在,请使用其他编号!") return record @api.onchange("name")