From 1c8b892faefeb7eed12e0e59e1aa9dadf58cdc5f 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 Dec 2025 11:35:06 +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 | 2 ++ yuthon_hr_employee_approval/models/yuthon_employee_add.py | 6 +++++- yuthon_purchase/models/inherit_purchase_order.py | 5 ++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/yuthon_contract/models/inherit_hr_contract.py b/yuthon_contract/models/inherit_hr_contract.py index 57d94974e..2d5f688e2 100644 --- a/yuthon_contract/models/inherit_hr_contract.py +++ b/yuthon_contract/models/inherit_hr_contract.py @@ -110,6 +110,8 @@ class HrContract(models.Model): 'view_mode': 'form', 'target': 'current', 'context': { + 'default_work_end': False, + 'default_self_users_ids':[(6, 0, [self.employee_id.user_id.id])], 'default_contract_id': contract_ids.id, 'default_employee_id': contract_ids.employee_id.id }} diff --git a/yuthon_hr_employee_approval/models/yuthon_employee_add.py b/yuthon_hr_employee_approval/models/yuthon_employee_add.py index c17ee508b..655051734 100644 --- a/yuthon_hr_employee_approval/models/yuthon_employee_add.py +++ b/yuthon_hr_employee_approval/models/yuthon_employee_add.py @@ -60,8 +60,12 @@ class YuthonEmployeeAdd(models.Model): @api.depends('contract_id', 'version') def _compute_name(self): for rec in self: + version_str = self.contract_id.version.lstrip('V') + main_version = version_str.split('.')[0] + new_main_version = int(main_version) + 1 + new_version = f"V{new_main_version}.0" if rec.contract_id: - rec.name = rec.contract_id.name + ' ' + rec.version + rec.name = rec.contract_id.name + ' ' + new_version else: rec.name = None diff --git a/yuthon_purchase/models/inherit_purchase_order.py b/yuthon_purchase/models/inherit_purchase_order.py index 671ce681a..0425a2f68 100644 --- a/yuthon_purchase/models/inherit_purchase_order.py +++ b/yuthon_purchase/models/inherit_purchase_order.py @@ -15,11 +15,10 @@ class InheritPurchaseOrder(models.Model): store=True ) code = fields.Char(string="流水号", default=lambda self: self.env['ir.sequence'].next_by_code('purchase_workflow_approval_code')) - state = fields.Selection(selection_add=[('申请人', '申请人'), - ('部门经理', '部门经理'), + state = fields.Selection(selection_add=[('部门经理', '部门经理'), ('协办', '协办'), ('分管领导', '分管领导'), - ('总经理', '总经理')] ,default='申请人') + ('总经理', '总经理')], default='draft') work_end = fields.Boolean(string="结束") user_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user) company_id = fields.Many2one(related='user_id.employee_ids.company_id', string="公司")