diff --git a/yuthon_hr_employee/models/yuthon_medical_manage.py b/yuthon_hr_employee/models/yuthon_medical_manage.py index f950cc2a5..269dbea9c 100644 --- a/yuthon_hr_employee/models/yuthon_medical_manage.py +++ b/yuthon_hr_employee/models/yuthon_medical_manage.py @@ -109,9 +109,16 @@ class YuthonMedicalManage(models.Model): current_date = fields.Date.today() current_year = str(current_date.year) last_year = str(int(current_year) - 1) + target_companies = ['广州市天河投资集团有限公司', '广州市天投城市建设开发有限公司', + '广州天投云擎数字科技有限公司'] + party_setting_records = self.env['yuthon.party.setting'].search([ + ('party', 'in', target_companies) + ]).ids open_employees = self.env['hr.employee'].search([ ('user_state', '=', 'in'), - ('company_id.name', '=', '集团本部') + ('company_id.name', '=', '集团本部'), + ('contract_id.party_id', 'in', party_setting_records), + ('active', '=', True) ]) for employee in open_employees: medical_manage_rec = self.env['yuthon.medical.manage'].search([ diff --git a/yuthon_hr_employee/models/yuthon_party_setting.py b/yuthon_hr_employee/models/yuthon_party_setting.py index b693b66eb..6c054e4e5 100644 --- a/yuthon_hr_employee/models/yuthon_party_setting.py +++ b/yuthon_hr_employee/models/yuthon_party_setting.py @@ -16,6 +16,7 @@ class YuthonPartySetting(models.Model): address = fields.Text(string='通讯地址') contact = fields.Char(string='联系人') phone = fields.Char(string='电话') + level = fields.Selection([('one', '一级'), ('two', '二级'), ('three', '三级')], string='层级') effective_date = fields.Date(string="生效日期", default=fields.Date.today) expiration_date = fields.Date(string="失效日期") diff --git a/yuthon_hr_employee/views/yuthon_party_setting_views.xml b/yuthon_hr_employee/views/yuthon_party_setting_views.xml index 109e1e9aa..2bf714677 100644 --- a/yuthon_hr_employee/views/yuthon_party_setting_views.xml +++ b/yuthon_hr_employee/views/yuthon_party_setting_views.xml @@ -13,6 +13,7 @@ +