diff --git a/yuthon_salary/models/yuthon_salary_active.py b/yuthon_salary/models/yuthon_salary_active.py
index a03415e0f..b073b5a78 100644
--- a/yuthon_salary/models/yuthon_salary_active.py
+++ b/yuthon_salary/models/yuthon_salary_active.py
@@ -55,6 +55,7 @@ class YuthonSalaryActive(models.Model):
basic_endowment_insurance = fields.Float(string='基本养老保险费')
basic_medical_insurance = fields.Float(string='基本医疗保险费')
unemployment_insurance = fields.Float(string='失业保险费')
+ insurance = fields.Float(string='保险', compute='_compute_insurance')
housing_fund = fields.Float(string='住房公积金')
enterprise_annuity = fields.Float(string='企业(职业)年金')
personal_payment_total_including_annuity = fields.Float(string='个人缴纳合计(含年金)')
@@ -78,6 +79,11 @@ class YuthonSalaryActive(models.Model):
reimbursed_medical_exam_fee = fields.Float(string='已报销体检费')
remaining_medical_exam_fee = fields.Float(string='剩余体检费')
+ @api.depends("basic_endowment_insurance", "basic_medical_insurance", "unemployment_insurance",)
+ def _compute_insurance(self):
+ for rec in self:
+ rec.insurance = rec.basic_endowment_insurance + rec.basic_medical_insurance + rec.unemployment_insurance
+
def salary_confirm(self):
self.write({'confirm_status': 'confirm'})
diff --git a/yuthon_salary/views/yuthon_salary_active_views.xml b/yuthon_salary/views/yuthon_salary_active_views.xml
index 91569d1f6..84482cc1b 100644
--- a/yuthon_salary/views/yuthon_salary_active_views.xml
+++ b/yuthon_salary/views/yuthon_salary_active_views.xml
@@ -61,7 +61,7 @@
-
+
@@ -89,37 +89,15 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+