From 243b10b2a62f8cf6635611b56ee6cf292f32eadb 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: Mon, 15 Sep 2025 17:31:11 +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 --- yuthon_contract/models/inherit_hr_contract.py | 1 + yuthon_property/models/yuthon_property.py | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/yuthon_contract/models/inherit_hr_contract.py b/yuthon_contract/models/inherit_hr_contract.py index 81f35ef22..dded121ad 100644 --- a/yuthon_contract/models/inherit_hr_contract.py +++ b/yuthon_contract/models/inherit_hr_contract.py @@ -65,6 +65,7 @@ class HrContract(models.Model): def _onchange_date_end(self): for record in self: if record.date_start: + record.employee_id.entry_date = record.date_start record.date_end = record.date_start + relativedelta(years=1) - relativedelta(days=1) @api.onchange('contract_type_id') diff --git a/yuthon_property/models/yuthon_property.py b/yuthon_property/models/yuthon_property.py index e51340d69..e6f82f93d 100644 --- a/yuthon_property/models/yuthon_property.py +++ b/yuthon_property/models/yuthon_property.py @@ -171,7 +171,14 @@ class YuthonProperty(models.Model): for rec in self.energy_meter_ids: meter_id = self.env['property.meter.archives'].search([('id', '=', rec.property_meter_archives_id.id)]) meter_id.write({ - 'yuthon_property_id': self.id.origin}) + 'yuthon_property_ids': [(6, 0, [self.id.origin])]}) + + @api.onchange('water_meter_ids') + def _onchange_water_meter_idss(self): + for rec in self.water_meter_ids: + meter_id = self.env['yuthon.property.water'].search([('id', '=', rec.property_meter_water_id.id)]) + meter_id.write({ + 'yuthon_property_ids': [(6, 0, [self.id.origin])]}) @api.onchange('building_area') def _onchange_building_area(self):