From 0eb58775c9e9e61cd9ab7d288ebcb07791f98aa6 Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Thu, 8 Mar 2018 16:09:33 +0100 Subject: [PATCH] [IMP] hr: Add a specific marital status 'Legal Cohabitant' Purpose ======= Currently both 'Married' and 'Legal Cohabitant' are considered as the same thing. We should separate these 2 marital status to have a more accurate information. --- addons/hr/models/hr.py | 3 ++- .../data/l10n_be_hr_payroll_data.xml | 12 ++++++------ .../views/l10n_be_hr_payroll_view.xml | 8 ++++---- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/addons/hr/models/hr.py b/addons/hr/models/hr.py index b34fcc99502..a0ba527a5c7 100644 --- a/addons/hr/models/hr.py +++ b/addons/hr/models/hr.py @@ -126,7 +126,8 @@ class Employee(models.Model): ], groups="hr.group_hr_user", default="male") marital = fields.Selection([ ('single', 'Single'), - ('married', 'Married (or similar)'), + ('married', 'Married'), + ('cohabitant', 'Legal Cohabitant'), ('widower', 'Widower'), ('divorced', 'Divorced') ], string='Marital Status', groups="hr.group_hr_user", default='single') diff --git a/addons/l10n_be_hr_payroll/data/l10n_be_hr_payroll_data.xml b/addons/l10n_be_hr_payroll/data/l10n_be_hr_payroll_data.xml index 0f6bb86479f..6920f154d9d 100644 --- a/addons/l10n_be_hr_payroll/data/l10n_be_hr_payroll_data.xml +++ b/addons/l10n_be_hr_payroll/data/l10n_be_hr_payroll_data.xml @@ -160,7 +160,7 @@ elif salary <= 2510.47: 165 python - result = (((employee.marital in ['divorced', 'single', 'widower']) or (employee.marital=='married' and employee.spouse_fiscal_status=='without income')) and (employee.resident_bool!=True)) + result = (((employee.marital in ['divorced', 'single', 'widower']) or (employee.marital in ['married', 'cohabitant'] and employee.spouse_fiscal_status=='without income')) and (employee.resident_bool!=True)) code wage = categories.BASIC @@ -184,7 +184,7 @@ else: 165 python - result = (((employee.marital=='married' and employee.spouse_fiscal_status=='with income')) and (employee.resident_bool!=True)) + result = (((employee.marital in ['married', 'cohabitant'] and employee.spouse_fiscal_status=='with income')) and (employee.resident_bool!=True)) code wage = categories.BASIC @@ -208,7 +208,7 @@ else: 120 python - result = (((employee.marital in ['divorced', 'single', 'widower']) or (employee.marital=='married' and employee.spouse_fiscal_status=='with income')) and (employee.resident_bool!=True)) + result = (((employee.marital in ['divorced', 'single', 'widower']) or (employee.marital in ['married', 'cohabitant'] and employee.spouse_fiscal_status=='with income')) and (employee.resident_bool!=True)) @@ -218,7 +218,7 @@ else: 120 python - result = ((employee.marital=='married' and employee.spouse_fiscal_status=='without income') and (employee.resident_bool!=True)) + result = ((employee.marital in ['married', 'cohabitant'] and employee.spouse_fiscal_status=='without income') and (employee.resident_bool!=True)) @@ -361,7 +361,7 @@ elif salary <= 2461.27: Red.Spouse.Net 148 python - result = (employee.marital == 'married' and employee.spouse_fiscal_status=='with income' and employee.spouse_net_revenue <= 225.0) and (categories.PP + categories.PPRed + categories.FamRed + categories.ChA < 0.0) + result = (employee.marital in ['married', 'cohabitant'] and employee.spouse_fiscal_status=='with income' and employee.spouse_net_revenue <= 225.0) and (categories.PP + categories.PPRed + categories.FamRed + categories.ChA < 0.0) code result = min(110.50, - (categories.PP + categories.PPRed + categories.FamRed + categories.ChA)) @@ -372,7 +372,7 @@ elif salary <= 2461.27: Red.Spouse.Oth.Net 149 python - result = (employee.marital == 'married' and employee.spouse_fiscal_status=='with income' and not employee.spouse_net_revenue and employee.spouse_other_net_revenue <= 450.0) and (categories.PP + categories.PPRed + categories.FamRed + categories.ChA < 0.0) + result = (employee.marital in ['married', 'cohabitant'] and employee.spouse_fiscal_status=='with income' and not employee.spouse_net_revenue and employee.spouse_other_net_revenue <= 450.0) and (categories.PP + categories.PPRed + categories.FamRed + categories.ChA < 0.0) code result = min(220.0, - (categories.PP + categories.PPRed + categories.FamRed + categories.ChA)) diff --git a/addons/l10n_be_hr_payroll/views/l10n_be_hr_payroll_view.xml b/addons/l10n_be_hr_payroll/views/l10n_be_hr_payroll_view.xml index 37fa58ae2b7..167dfb866a5 100644 --- a/addons/l10n_be_hr_payroll/views/l10n_be_hr_payroll_view.xml +++ b/addons/l10n_be_hr_payroll/views/l10n_be_hr_payroll_view.xml @@ -131,8 +131,8 @@ - - + + @@ -148,8 +148,8 @@ - - + +