From ec7781faa1354f5dd14b06166ac2a70c2b248ba2 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Thu, 28 Aug 2025 17:40:03 +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 | 15 +++ .../views/inherit_hr_contract_views.xml | 4 +- .../views/yuthon_hr_employee_views.xml | 103 ++++++------------ .../wizard/property_reconciliation_wizard.py | 14 +-- 4 files changed, 58 insertions(+), 78 deletions(-) diff --git a/yuthon_contract/models/inherit_hr_contract.py b/yuthon_contract/models/inherit_hr_contract.py index 764021753..8d65fd1dc 100644 --- a/yuthon_contract/models/inherit_hr_contract.py +++ b/yuthon_contract/models/inherit_hr_contract.py @@ -57,6 +57,21 @@ class HrContract(models.Model): if record.date_start: record.date_end = record.date_start + relativedelta(years=1) - relativedelta(days=1) + @api.onchange('contract_type_id') + def _onchange_contract_type_id(self): + for record in self: + if record.contract_type_id: + if record.contract_type_id.name == '正式合同(一签)': + record.date_end = record.date_start + relativedelta(years=1) - relativedelta(days=1) + elif record.contract_type_id.name == '正式合同(二签)': + record.date_end = record.date_start + relativedelta(years=3) - relativedelta(days=1) + + @api.onchange('date_start') + def _onchange_date_start(self): + for record in self: + if record.date_start and record.state == 'open' and record.employee_id: + record.employee_id.entry_date = record.date_start + def renew(self): contract_ids = self.env["hr.contract"].browse( self._context.get('active_ids', self._context.get('active_id'))) diff --git a/yuthon_contract/views/inherit_hr_contract_views.xml b/yuthon_contract/views/inherit_hr_contract_views.xml index 81994c96a..41eb98ece 100644 --- a/yuthon_contract/views/inherit_hr_contract_views.xml +++ b/yuthon_contract/views/inherit_hr_contract_views.xml @@ -17,8 +17,10 @@ - + + + diff --git a/yuthon_hr_employee/views/yuthon_hr_employee_views.xml b/yuthon_hr_employee/views/yuthon_hr_employee_views.xml index e0989dceb..a5fea1628 100644 --- a/yuthon_hr_employee/views/yuthon_hr_employee_views.xml +++ b/yuthon_hr_employee/views/yuthon_hr_employee_views.xml @@ -366,76 +366,39 @@ hr.employee - - /employee/banner/route - 20 - - - 1 - - - 1 - - - hide - - - 上级单位 - - - list_employee_width - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - hide - - - 1 - - - hide - - - 1 - - - hide + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/yuthon_property_approval/wizard/property_reconciliation_wizard.py b/yuthon_property_approval/wizard/property_reconciliation_wizard.py index cc1d1ecd6..8c998e321 100644 --- a/yuthon_property_approval/wizard/property_reconciliation_wizard.py +++ b/yuthon_property_approval/wizard/property_reconciliation_wizard.py @@ -367,10 +367,10 @@ class PropertyReconciliationWizard(models.Model): rec.bank_id.write({ 'create_receivable_ids': [(4, receivable_id.id)] }) - if receivable_id: - rec.bank_id.write({ - 'create_receivable_ids': [(4, receivable_id.id)] - }) + # if receivable_id: + # rec.bank_id.write({ + # 'create_receivable_ids': [(4, receivable_id.id)] + # }) else: existing_record.write({ 'delivered1': existing_record.delivered1 + line.amount, @@ -382,9 +382,9 @@ class PropertyReconciliationWizard(models.Model): 'is_write': True if line.amount != 0 else None, 'reconciliation_time': fields.Datetime.now(), }) - rec.bank_id.write({ - 'write_receivable_ids': [(4, existing_record.id)] - }) + # rec.bank_id.write({ + # 'write_receivable_ids': [(4, existing_record.id)] + # }) # 计算已对账和未对账金额 rec.amount_been_reconciled += line.amount