From 6587768281edb5b6fed184ce1c1525cd3ed60af1 Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Thu, 26 Jul 2018 13:01:21 -0700 Subject: [PATCH 1/6] Initial commit of `hr_workers_comp` and `hr_workers_comp_payroll` for 11.0 --- hr_workers_comp/__init__.py | 1 + hr_workers_comp/__manifest__.py | 22 +++++++++ hr_workers_comp/contract.py | 25 ++++++++++ hr_workers_comp/contract_views.xml | 73 +++++++++++++++++++++++++++++ hr_workers_comp/ir.model.access.csv | 3 ++ 5 files changed, 124 insertions(+) create mode 100755 hr_workers_comp/__init__.py create mode 100755 hr_workers_comp/__manifest__.py create mode 100644 hr_workers_comp/contract.py create mode 100644 hr_workers_comp/contract_views.xml create mode 100644 hr_workers_comp/ir.model.access.csv diff --git a/hr_workers_comp/__init__.py b/hr_workers_comp/__init__.py new file mode 100755 index 00000000..99a5468a --- /dev/null +++ b/hr_workers_comp/__init__.py @@ -0,0 +1 @@ +from . import contract diff --git a/hr_workers_comp/__manifest__.py b/hr_workers_comp/__manifest__.py new file mode 100755 index 00000000..55599c5c --- /dev/null +++ b/hr_workers_comp/__manifest__.py @@ -0,0 +1,22 @@ +{ + 'name': 'Workers\' Compensation Class', + 'author': 'Hibou Corp. ', + 'license': 'AGPL-3', + 'category': 'Human Resources', + 'depends': ['hr_contract'], + 'version': '11.0.0.0.0', + 'description': """ +Workers' Compensation Class +=========================== + +Provides a model to keep track of Workers' Comp. Class Codes and Rates. + """, + + 'auto_install': False, + 'website': 'https://hibou.io/', + 'data':[ + 'ir.model.access.csv', + 'contract_views.xml', + ], + 'installable': True +} diff --git a/hr_workers_comp/contract.py b/hr_workers_comp/contract.py new file mode 100644 index 00000000..fb27536c --- /dev/null +++ b/hr_workers_comp/contract.py @@ -0,0 +1,25 @@ +from odoo import api,fields,models + + +class HRContract(models.Model): + _inherit = 'hr.contract' + + wc_code_id = fields.Many2one('hr.wc_code', string='Workers Comp. Code') + + +class WorkersCompensationClass(models.Model): + _name = 'hr.wc_code' + _description = "Workers Comp. Code" + _rec_name = 'display_name' + _order = 'code' + + active = fields.Boolean('Active', default=True) + name = fields.Char('Name') + code = fields.Char('Code') + rate = fields.Float('Rate', digits=(7, 6), company_dependent=True) + display_name = fields.Char(compute='_compute_clean_display_name', store=True) + + @api.depends('name', 'code') + def _compute_clean_display_name(self): + for rec in self: + rec.display_name = '%s %s' % (rec.code, rec.name) diff --git a/hr_workers_comp/contract_views.xml b/hr_workers_comp/contract_views.xml new file mode 100644 index 00000000..81e7e6d9 --- /dev/null +++ b/hr_workers_comp/contract_views.xml @@ -0,0 +1,73 @@ + + + + hr.wc_code.tree + hr.wc_code + + + + + + + + + + + hr.wc_code.form + hr.wc_code + +
+ + + + + + + + + + + +
+
+
+ + + hr.wc_code.search + hr.wc_code + + + + + + + + + + Workers Compensation Codes + hr.wc_code + form + tree,form + +

+ No codes +

+
+
+ + + + + + hr.contract.form.inherit + hr.contract + + + + + + + +
\ No newline at end of file diff --git a/hr_workers_comp/ir.model.access.csv b/hr_workers_comp/ir.model.access.csv new file mode 100644 index 00000000..a3be149a --- /dev/null +++ b/hr_workers_comp/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_hr_wc_code,access_hr_wc_code,model_hr_wc_code,base.group_user,1,0,0,0 +manage_hr_hr_wc_code,manage_hr_hr_wc_code,model_hr_wc_code,hr.group_hr_user,1,1,1,1 \ No newline at end of file From 4634bc9f400b292854b04500324add3f819299e8 Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Thu, 26 Jul 2018 13:01:21 -0700 Subject: [PATCH 2/6] Initial commit of `hr_workers_comp` and `hr_workers_comp_payroll` for 11.0 --- hr_workers_comp_payroll/__init__.py | 1 + hr_workers_comp_payroll/__manifest__.py | 21 +++++++++++++++++++++ hr_workers_comp_payroll/payslip.py | 8 ++++++++ hr_workers_comp_payroll/payslip_views.xml | 14 ++++++++++++++ 4 files changed, 44 insertions(+) create mode 100755 hr_workers_comp_payroll/__init__.py create mode 100755 hr_workers_comp_payroll/__manifest__.py create mode 100644 hr_workers_comp_payroll/payslip.py create mode 100644 hr_workers_comp_payroll/payslip_views.xml diff --git a/hr_workers_comp_payroll/__init__.py b/hr_workers_comp_payroll/__init__.py new file mode 100755 index 00000000..305e17f9 --- /dev/null +++ b/hr_workers_comp_payroll/__init__.py @@ -0,0 +1 @@ +from . import payslip diff --git a/hr_workers_comp_payroll/__manifest__.py b/hr_workers_comp_payroll/__manifest__.py new file mode 100755 index 00000000..2ccbb78d --- /dev/null +++ b/hr_workers_comp_payroll/__manifest__.py @@ -0,0 +1,21 @@ +{ + 'name': 'Workers\' Compensation Class - Payroll', + 'author': 'Hibou Corp. ', + 'license': 'AGPL-3', + 'category': 'Human Resources', + 'depends': ['hr_contract'], + 'version': '11.0.0.0.0', + 'description': """ +Workers' Compensation Class - Payroll +===================================== + +Links Payslips with Contract's WC Codes. Useful for reporting and grouping payslips. +Salary Rules can now make use of the Workers Comp code and rate. + """, + 'auto_install': True, + 'website': 'https://hibou.io/', + 'data':[ + 'payslip_views.xml', + ], + 'installable': True +} diff --git a/hr_workers_comp_payroll/payslip.py b/hr_workers_comp_payroll/payslip.py new file mode 100644 index 00000000..31833a83 --- /dev/null +++ b/hr_workers_comp_payroll/payslip.py @@ -0,0 +1,8 @@ +from odoo import api,fields,models + + +class Payslip(models.Model): + _inherit = 'hr.payslip' + + contract_wc_code_id = fields.Many2one('hr.wc_code', string='Workers Comp. Code', + related='contract_id.wc_code_id', store=True) diff --git a/hr_workers_comp_payroll/payslip_views.xml b/hr_workers_comp_payroll/payslip_views.xml new file mode 100644 index 00000000..0264404f --- /dev/null +++ b/hr_workers_comp_payroll/payslip_views.xml @@ -0,0 +1,14 @@ + + + + + hr.payslip.form.inherit + hr.payslip + + + + + + + + \ No newline at end of file From 8ae3c07b35b417bb7145d3f47ecad3b1674ab6c9 Mon Sep 17 00:00:00 2001 From: Kristen Marie Kulha Date: Fri, 24 Aug 2018 18:11:45 -0700 Subject: [PATCH 3/6] Added `hr_workers_comp` dependency to `hr_workers_comp_payroll`. --- hr_workers_comp_payroll/__manifest__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hr_workers_comp_payroll/__manifest__.py b/hr_workers_comp_payroll/__manifest__.py index 2ccbb78d..f3aebf27 100755 --- a/hr_workers_comp_payroll/__manifest__.py +++ b/hr_workers_comp_payroll/__manifest__.py @@ -3,7 +3,10 @@ 'author': 'Hibou Corp. ', 'license': 'AGPL-3', 'category': 'Human Resources', - 'depends': ['hr_contract'], + 'depends': [ + 'hr_contract', + 'hr_workers_comp', + ], 'version': '11.0.0.0.0', 'description': """ Workers' Compensation Class - Payroll From 28cd927ee27982b5acb678718ed286114446e157 Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Mon, 27 Aug 2018 15:55:24 -0700 Subject: [PATCH 4/6] IMP Allow FICA Exemption (e.g. for F1 Student Visa) Additionally, improve requirements on `hr_workers_comp_payroll` --- hr_workers_comp_payroll/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hr_workers_comp_payroll/__manifest__.py b/hr_workers_comp_payroll/__manifest__.py index f3aebf27..0bdaaa76 100755 --- a/hr_workers_comp_payroll/__manifest__.py +++ b/hr_workers_comp_payroll/__manifest__.py @@ -4,7 +4,7 @@ 'license': 'AGPL-3', 'category': 'Human Resources', 'depends': [ - 'hr_contract', + 'hr_payroll', 'hr_workers_comp', ], 'version': '11.0.0.0.0', From 1dafc570d945ee5ae7147eed686f230238e57677 Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Mon, 20 May 2019 14:49:40 -0700 Subject: [PATCH 5/6] MIG `hr_workers_comp` to 12.0 --- hr_workers_comp/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hr_workers_comp/__manifest__.py b/hr_workers_comp/__manifest__.py index 55599c5c..ba700b06 100755 --- a/hr_workers_comp/__manifest__.py +++ b/hr_workers_comp/__manifest__.py @@ -4,7 +4,7 @@ 'license': 'AGPL-3', 'category': 'Human Resources', 'depends': ['hr_contract'], - 'version': '11.0.0.0.0', + 'version': '12.0.1.0.0', 'description': """ Workers' Compensation Class =========================== From a0718b5d7bc3e3bdb73fc33e4d9541e4184077b9 Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Mon, 20 May 2019 14:49:54 -0700 Subject: [PATCH 6/6] MIG `hr_workers_comp_payroll` to 12.0 --- hr_workers_comp_payroll/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hr_workers_comp_payroll/__manifest__.py b/hr_workers_comp_payroll/__manifest__.py index 0bdaaa76..ed9319e8 100755 --- a/hr_workers_comp_payroll/__manifest__.py +++ b/hr_workers_comp_payroll/__manifest__.py @@ -7,7 +7,7 @@ 'hr_payroll', 'hr_workers_comp', ], - 'version': '11.0.0.0.0', + 'version': '12.0.1.0.0', 'description': """ Workers' Compensation Class - Payroll =====================================