From 149efb7924eee5d767e48eae57954651fe577d1e Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Sun, 23 Mar 2025 16:27:46 +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 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/yuthon_contract/models/inherit_hr_contract.py b/yuthon_contract/models/inherit_hr_contract.py index 534c7e9dd..50f0962e5 100644 --- a/yuthon_contract/models/inherit_hr_contract.py +++ b/yuthon_contract/models/inherit_hr_contract.py @@ -19,8 +19,7 @@ class HrContract(models.Model): ('attendance', 'Attendances'), ('planning', '特殊排版')]) is_probation = fields.Boolean(string="试用期") - wage = fields.Monetary('Wage', required=True, tracking=True, help="Employee's monthly gross wage.", - group_operator="avg", compute='_compute_wage') + wage = fields.Float(string="基本工资", compute='_compute_wage', store=True) start_date = fields.Date(string="开始日期", required=True, default=fields.Date.today) end_date = fields.Date(string="结束日期", required=True, default=lambda self: fields.Date.today() + relativedelta(months=+3)) @@ -48,7 +47,7 @@ class HrContract(models.Model): def _compute_wage(self): for record in self: if record.structure_type_id and record.yuthon_company: - wage_id = self.env['hr.salary.rule'].search([('struct_id.name', '=', record.structure_type_id.name), + wage_id = self.env['hr.salary.rule'].search([('struct_id', '=', record.structure_type_id.default_struct_id.id), ('yuthon_company','=', record.yuthon_company), ('name', '=','基本工资')]) if wage_id: record.wage = wage_id.amount_fix