From fcb742b722b56a81f8fadc814127a65d59a0ec17 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Thu, 15 May 2025 20:19:00 +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 --- .../models/property_lease_contract.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/yuthon_property_approval/models/property_lease_contract.py b/yuthon_property_approval/models/property_lease_contract.py index cb5030dc2..ba4cdf289 100644 --- a/yuthon_property_approval/models/property_lease_contract.py +++ b/yuthon_property_approval/models/property_lease_contract.py @@ -887,7 +887,7 @@ class PropertyLeaseContract(models.Model): rec.electricity_fee_ids = [(5, 0, 0)] rec.mange_fee_ids = [(5, 0, 0)] - rec.admin_id = rec.lease_ids[0].admin_id.id if rec.lease_ids else '' + rec.admin_id = rec.lease_ids[0].admin_line_id.id if rec.lease_ids else '' rec.company_id = rec.lease_ids[0].address_id.company_id.id if rec.lease_ids else '' rec.precinct_id = rec.lease_ids[0].address_id.precinct_id.id if rec.lease_ids else '' rec.total_area = sum([lease.property_area for lease in rec.lease_ids]) @@ -898,7 +898,7 @@ class PropertyLeaseContract(models.Model): property_ids = self.env["property.lease.contract"].browse(self._context.get('active_ids', self._context.get('active_id'))) for record in property_ids: company_id = record.lease_ids[0].address_id.company_id.id if record.lease_ids else '' - admin_id = record.lease_ids[0].admin_id.id if record.lease_ids else '' + admin_id = record.lease_ids[0].admin_line_id.id if record.lease_ids else '' record.write({'company_id': company_id, 'admin_id': admin_id, 'actual_end_time': datetime.now(), @@ -1125,7 +1125,7 @@ class PropertyLeaseContract(models.Model): def _compute_admin_id(self): for record in self: if record.lease_ids: - record.admin_id = record.lease_ids[0].admin_id.id + record.admin_id = record.lease_ids[0].admin_line_id.id def get_property_contract_time(self): unique_property_ids = set() @@ -1196,7 +1196,7 @@ class PropertyLeaseContract(models.Model): for record in self: property_ids = [] rent_area = 0 - first_address_id = record.lease_ids[0].address_id if record.lease_ids else None + first_address_id = record.lease_ids[0].admin_line_id if record.lease_ids else None for lease_id in record.lease_ids: property_ids.append(lease_id.address_id.id) rent_area += lease_id.address_id.rent_area @@ -1224,7 +1224,7 @@ class PropertyLeaseContract(models.Model): contract_ids = self.env["property.lease.contract"].browse(self._context.get('active_ids', self._context.get('active_id'))) for record in contract_ids: property_ids = [] - property_id = record.lease_ids[0].address_id + property_id = record.lease_ids[0].admin_line_id if record.property_state == 'done': raise UserError(f'{record.name}该物业已评估,请勿重复评估') rent_area = 0 From 68458e5ea2cebe40fcd1f37d40493fa91a12f402 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Thu, 15 May 2025 20:46:43 +0800 Subject: [PATCH 2/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 --- soong_workflow/models/soong_workflow_mixin.py | 6 +++--- yuthon_property_approval/models/property_lease_contract.py | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/soong_workflow/models/soong_workflow_mixin.py b/soong_workflow/models/soong_workflow_mixin.py index dd0e6238a..4014b9198 100644 --- a/soong_workflow/models/soong_workflow_mixin.py +++ b/soong_workflow/models/soong_workflow_mixin.py @@ -850,9 +850,9 @@ class SoongWorkflowMixin(models.AbstractModel): field_attrs.group_ids or field_attrs.user_ids ): invisible_arr.append(node.node_name) - if self.env.user.has_group("soong_workflow.group_soong_workflow_manager"): - field_inst.set("readonly", "0") - else: + # if self.env.user.has_group("soong_workflow.group_soong_workflow_manager"): + # field_inst.set("readonly", "0") + # else: # Set Attributes # if self.state in readonly_arr : # field_inst.set("readonly", "1") diff --git a/yuthon_property_approval/models/property_lease_contract.py b/yuthon_property_approval/models/property_lease_contract.py index ba4cdf289..4f586e452 100644 --- a/yuthon_property_approval/models/property_lease_contract.py +++ b/yuthon_property_approval/models/property_lease_contract.py @@ -68,9 +68,9 @@ class PropertyLeaseContract(models.Model): active = fields.Boolean('Active', default=True, tracking=True) lease_term = fields.Float(string="租期") - lease_term_year = fields.Integer(string="租期(年)",default=lambda self: datetime.now().year) - lease_term_month = fields.Integer(string="租期(月)",default=lambda self: datetime.now().month) - lease_term_day = fields.Integer(string="租期(日)",default=lambda self: datetime.now().day) + lease_term_year = fields.Integer(string="租期(年)") + lease_term_month = fields.Integer(string="租期(月)") + lease_term_day = fields.Integer(string="租期(日)") term_start_time = fields.Date(string="合约开始时间", default=fields.Datetime.now) term_end_time = fields.Date(string="合约结束时间") actual_start_time = fields.Date(string="实际开始时间") @@ -447,6 +447,7 @@ class PropertyLeaseContract(models.Model): # todo 还没有计算递增递减 # todo 还没有计算首月优惠 # todo 还没有计算开始和结束不足月份和季度的计算比例 + for record in self: if record.term_start_time and record.term_end_time: record.write({'breakdown_ids': [(5, 0, 0)]}) From cfd9f4d8188a9a87dd861e86f20cdebe2a2cae2f Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Thu, 15 May 2025 20:46:57 +0800 Subject: [PATCH 3/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 --- soong_workflow/models/soong_workflow_mixin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/soong_workflow/models/soong_workflow_mixin.py b/soong_workflow/models/soong_workflow_mixin.py index 4014b9198..dd0e6238a 100644 --- a/soong_workflow/models/soong_workflow_mixin.py +++ b/soong_workflow/models/soong_workflow_mixin.py @@ -850,9 +850,9 @@ class SoongWorkflowMixin(models.AbstractModel): field_attrs.group_ids or field_attrs.user_ids ): invisible_arr.append(node.node_name) - # if self.env.user.has_group("soong_workflow.group_soong_workflow_manager"): - # field_inst.set("readonly", "0") - # else: + if self.env.user.has_group("soong_workflow.group_soong_workflow_manager"): + field_inst.set("readonly", "0") + else: # Set Attributes # if self.state in readonly_arr : # field_inst.set("readonly", "1")