From c7293e82b7c4d81d8a1fe654a1575b72aed9c095 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: Fri, 26 Sep 2025 10:58:21 +0800 Subject: [PATCH] =?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/soong_workflow_record.xml | 4 +- .../models/property_meter_archives.py | 1 + .../models/property_meter_water.py | 1 + .../models/property_tariff_list.py | 2 - yuthon_property/models/property_water_list.py | 2 - .../views/property_tariff_list_views.xml | 1 - .../views/property_water_list_views.xml | 1 - .../models/inherit_yuthon_property.py | 4 ++ .../models/property_lease_contract.py | 5 +- .../models/property_lease_renewal.py | 1 + .../views/inherit_yuthon_property_views.xml | 16 +++-- .../wizard/property_rental_wizard.py | 67 +++++++++++++------ 12 files changed, 68 insertions(+), 37 deletions(-) diff --git a/soong_workflow/views/soong_workflow_record.xml b/soong_workflow/views/soong_workflow_record.xml index 6d164f9ef..ae5e2bae5 100644 --- a/soong_workflow/views/soong_workflow_record.xml +++ b/soong_workflow/views/soong_workflow_record.xml @@ -23,8 +23,8 @@ - - + + diff --git a/yuthon_property/models/property_meter_archives.py b/yuthon_property/models/property_meter_archives.py index 917f9f0af..af94e4099 100644 --- a/yuthon_property/models/property_meter_archives.py +++ b/yuthon_property/models/property_meter_archives.py @@ -19,6 +19,7 @@ class PropertyMeterArchives(models.Model): lessee_id = fields.Many2one('property.tenant.information', string='承租方', store=True, compute='_compute_lessee_id') employee_ids = fields.Many2many('hr.employee', string='抄表人') epitope_values = fields.Char(string='表位置') + epitope_values_id = fields.Many2one('yuthon.epitope.values', string='表位置') other = fields.Char(string='其他') unit = fields.Float(string='当月单价') archives_state = fields.Selection([('stop', '停用'), ('use', '正常'), ('rent', '出租')], string='状态', compute='_compute_archives_state', store=True, default='use') diff --git a/yuthon_property/models/property_meter_water.py b/yuthon_property/models/property_meter_water.py index b94a8f4e1..7ee467139 100644 --- a/yuthon_property/models/property_meter_water.py +++ b/yuthon_property/models/property_meter_water.py @@ -135,6 +135,7 @@ class MeterWaterLine(models.Model): end_time = fields.Date(string="拆除日期") water_state = fields.Selection([('stop', '停用'), ('use', '使用'), ('rent', '出租')], string='状态') state = fields.Selection([('reading', '已抄'), ('unreading', '未抄')], string='抄表状态', default='unreading') + epitope_values_id = fields.Many2one('yuthon.epitope.values', string='表位置') remarks = fields.Text(string='备注') employee_ids = fields.Many2many('hr.employee', string='抄表人') maximum_count = fields.Integer(string='最大位数') diff --git a/yuthon_property/models/property_tariff_list.py b/yuthon_property/models/property_tariff_list.py index 7ed2cb876..40c66349d 100644 --- a/yuthon_property/models/property_tariff_list.py +++ b/yuthon_property/models/property_tariff_list.py @@ -5,8 +5,6 @@ class PropertyTariffList(models.Model): _name = 'property.tariff.list' _description = '电费列表' - property_id = fields.Many2one('yuthon.property', string='物业') - admin_id = fields.Many2one(related='property_id.admin_id', string="片区管理员", store=True) lessee_id = fields.Many2one('property.tenant.information', string='承租方') tariff_meter_number = fields.Char(string='电费编号') due_date = fields.Date(string='应收日期') diff --git a/yuthon_property/models/property_water_list.py b/yuthon_property/models/property_water_list.py index 085f95f16..dbfd36580 100644 --- a/yuthon_property/models/property_water_list.py +++ b/yuthon_property/models/property_water_list.py @@ -5,9 +5,7 @@ class PropertyWaterList(models.Model): _name = 'property.water.list' _description = '水费列表' - property_id = fields.Many2one('yuthon.property', string='物业') lessee_id = fields.Many2one('property.tenant.information', string='承租方') - admin_id = fields.Many2one(related='property_id.admin_id', string="片区管理员", store=True) water_meter_number = fields.Char(string='水表编号') due_date = fields.Date(string='应收日期') water_meter_reading = fields.Float(string='水表读数') diff --git a/yuthon_property/views/property_tariff_list_views.xml b/yuthon_property/views/property_tariff_list_views.xml index 997cee1bd..668c49b96 100644 --- a/yuthon_property/views/property_tariff_list_views.xml +++ b/yuthon_property/views/property_tariff_list_views.xml @@ -6,7 +6,6 @@ - diff --git a/yuthon_property/views/property_water_list_views.xml b/yuthon_property/views/property_water_list_views.xml index 5241ee273..8bbfb0263 100644 --- a/yuthon_property/views/property_water_list_views.xml +++ b/yuthon_property/views/property_water_list_views.xml @@ -6,7 +6,6 @@ - diff --git a/yuthon_property_approval/models/inherit_yuthon_property.py b/yuthon_property_approval/models/inherit_yuthon_property.py index 1e5e86ce5..8c5244a4c 100644 --- a/yuthon_property_approval/models/inherit_yuthon_property.py +++ b/yuthon_property_approval/models/inherit_yuthon_property.py @@ -819,6 +819,8 @@ class PropertyTariffList(models.Model): _inherit = 'property.tariff.list' contract_id = fields.Many2one('property.lease.contract', string="关联租赁合同审批") + admin_id = fields.Many2one(related='contract_id.admin_id', string="片区管理员", store=True) + property_name = fields.Char(related='contract_id.property_name', string="物业信息", store=True) def push_tariff(self): for rec in self: @@ -855,6 +857,8 @@ class PropertyWaterList(models.Model): _inherit = 'property.water.list' contract_id = fields.Many2one('property.lease.contract', string="关联租赁合同审批") + admin_id = fields.Many2one(related='contract_id.admin_id', string="片区管理员", store=True) + property_name = fields.Char(related='contract_id.property_name', string="物业信息") def push_water(self): for rec in self: diff --git a/yuthon_property_approval/models/property_lease_contract.py b/yuthon_property_approval/models/property_lease_contract.py index 02f69556c..5526484b9 100644 --- a/yuthon_property_approval/models/property_lease_contract.py +++ b/yuthon_property_approval/models/property_lease_contract.py @@ -69,7 +69,7 @@ class PropertyLeaseContract(models.Model): rent_company = fields.Char(related='lessor_id.name', string="收租公司名称") rent_account = fields.Char(related='lessor_id.rent_account', string="收租公司账号") users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user) - department_id = fields.Many2one('hr.department', string="部门", store=True, compute='_compute_admin_id') + department_id = fields.Many2one('hr.department', string="部门", default= lambda self: self.env.user.department_id) company_id = fields.Many2one(related='users_id.employee_id.company_id', string="公司") # 承租方的个人信息 lessee_id = fields.Many2one('property.tenant.information', string='承租方') @@ -270,7 +270,6 @@ class PropertyLeaseContract(models.Model): for record in self: if record.lease_ids: record.admin_id = record.lease_ids[0].address_id.admin_id.id - record.department_id = record.lease_ids[0].address_id.admin_id.department_id.id def contract_signature(self): return { @@ -399,8 +398,8 @@ class PropertyLeaseContract(models.Model): 'actual_start_time': contract.term_start_time, 'actual_end_time': contract.term_end_time, 'work_end': True}) + contract.get_property_contract_time() self._update_contract_lines(contract) - logs_to_update = self.env["soong.workflow.log"].search([ ("model", "=", self._name), ("res_id", "=", contract.id), diff --git a/yuthon_property_approval/models/property_lease_renewal.py b/yuthon_property_approval/models/property_lease_renewal.py index 5880ae057..4412a1b05 100644 --- a/yuthon_property_approval/models/property_lease_renewal.py +++ b/yuthon_property_approval/models/property_lease_renewal.py @@ -84,6 +84,7 @@ class PropertyLeaseRenewal(models.Model): else: rec.contract_id.write({ 'actual_end_time': rec.early_quitting_date}) + rec.contract_id.get_property_contract_time() rec.hide = True @api.onchange('contract_id', 'renewal_type') diff --git a/yuthon_property_approval/views/inherit_yuthon_property_views.xml b/yuthon_property_approval/views/inherit_yuthon_property_views.xml index e4ac55a99..36bdc4e71 100644 --- a/yuthon_property_approval/views/inherit_yuthon_property_views.xml +++ b/yuthon_property_approval/views/inherit_yuthon_property_views.xml @@ -153,13 +153,13 @@ property.tariff.list - + - + @@ -176,8 +176,10 @@