@@ -117,8 +117,12 @@ class YuthonMedicalManage(models.Model):
|
||||
current_date = fields.Date.today()
|
||||
current_year = str(current_date.year)
|
||||
last_year = str(int(current_year) - 1)
|
||||
target_companies = ['广州市天河投资集团有限公司', '广州市天投城市建设开发有限公司',
|
||||
'广州天投云擎数字科技有限公司', '广州市东进物业管理有限公司']
|
||||
valid_rules = self.env['yuthon.medical.rule'].search([
|
||||
('start_date', '<=', current_date),
|
||||
'|', ('end_date', '>=', current_date), ('end_date', '=', False)
|
||||
], order='start_date desc', limit=1)
|
||||
rule = valid_rules
|
||||
target_companies = rule.party_ids.mapped('name')
|
||||
party_setting_records = self.env['yuthon.party.setting'].search([
|
||||
('party', 'in', target_companies)
|
||||
]).ids
|
||||
@@ -126,7 +130,6 @@ class YuthonMedicalManage(models.Model):
|
||||
('user_state', '=', 'in'),
|
||||
('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([
|
||||
|
||||
@@ -12,6 +12,7 @@ class YuthonMedicalRule(models.Model):
|
||||
base_amount = fields.Float(string='基数金额')
|
||||
starting_age = fields.Integer(string='起始年龄')
|
||||
department_id = fields.Many2one("hr.department", string="部门")
|
||||
party_ids = fields.Many2many('yuthon.party.setting', string='甲方(用人单位)')
|
||||
extension_years = fields.Selection(selection=[(str(i), str(i)) for i in range(1, 13)], string='延续年限')
|
||||
increase_interval_years = fields.Integer(string='递增间隔(年)')
|
||||
increment_amount = fields.Float(string='递增金额')
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<field name="allowance_married_women"/>
|
||||
<field name="department_id" widget="ztree_select"/>
|
||||
<field name="extension_years"/>
|
||||
<field name="party_ids" widget="many2many_tags"/>
|
||||
<field name="company_id" required="1" optional="show"/>
|
||||
<field name="start_date"/>
|
||||
<field name="end_date"/>
|
||||
|
||||
Reference in New Issue
Block a user