From 337cfa511cbc6320bb40563905a1108707071e01 Mon Sep 17 00:00:00 2001 From: pinky <> Date: Wed, 7 Mar 2007 18:10:55 +0000 Subject: [PATCH] New module bzr revid: pinky-18bde0a42a7ccf5befdb18a4fe02ea8a99cbe4d7 --- addons/hr_contract/__init__.py | 1 + addons/hr_contract/__terp__.py | 14 ++ addons/hr_contract/arom_data.xml | 41 +++++ addons/hr_contract/hr_contract.py | 71 +++++++++ addons/hr_contract/hr_contract_view.xml | 198 ++++++++++++++++++++++++ addons/hr_timesheet_sheet/__terp__.py | 2 +- addons/multi_company/project_view.xml | 4 +- 7 files changed, 328 insertions(+), 3 deletions(-) create mode 100644 addons/hr_contract/__init__.py create mode 100644 addons/hr_contract/__terp__.py create mode 100644 addons/hr_contract/arom_data.xml create mode 100644 addons/hr_contract/hr_contract.py create mode 100644 addons/hr_contract/hr_contract_view.xml diff --git a/addons/hr_contract/__init__.py b/addons/hr_contract/__init__.py new file mode 100644 index 00000000000..8dad79ab54f --- /dev/null +++ b/addons/hr_contract/__init__.py @@ -0,0 +1 @@ +import hr_contract diff --git a/addons/hr_contract/__terp__.py b/addons/hr_contract/__terp__.py new file mode 100644 index 00000000000..761e0e402d6 --- /dev/null +++ b/addons/hr_contract/__terp__.py @@ -0,0 +1,14 @@ +{ + "name" : "Human Resources Contracts", + "version" : "0.1", + "author" : "Tiny", + "category" : "Generic Modules/Human Resources", + "website" : "http://tinyerp.com/module_hr.html", + "depends" : ["hr"], + "module": "", + "init_xml" : ["hr_contract_data.xml"], + "demo_xml" : [], + "update_xml" : ["hr_contract_view.xml"], + "active": False, + "installable": True +} diff --git a/addons/hr_contract/arom_data.xml b/addons/hr_contract/arom_data.xml new file mode 100644 index 00000000000..35d8bcd7c7c --- /dev/null +++ b/addons/hr_contract/arom_data.xml @@ -0,0 +1,41 @@ + + + + + + daily + + + weekly + + + monthly + + + + + Monthly Gross Wage + gross + + + + Monthly Net Wage + net + + + + + + Single + + + Married + + + Divorced + + + Widower + + + diff --git a/addons/hr_contract/hr_contract.py b/addons/hr_contract/hr_contract.py new file mode 100644 index 00000000000..b913d4142d2 --- /dev/null +++ b/addons/hr_contract/hr_contract.py @@ -0,0 +1,71 @@ +from osv import fields, osv + +class hr_employee_marital_status(osv.osv): + _name = "hr.employee.marital.status" + _description = "Employee Marital Status" + _columns = { + 'name' : fields.char('Marital Status', size=30, required=True), + 'description' : fields.text('Status Description'), + } +hr_employee_marital_status() + +class hr_employee(osv.osv): + _name = "hr.employee" + _description = "Employee" + _inherit = "hr.employee" + _columns = { + 'manager' : fields.boolean('Manager'), + 'soc_security' : fields.char('Social security number', size=50, select=True), + 'medic_exam' : fields.date('Medical examination date'), + 'audiens_num' : fields.char('AUDIENS Number', size=30), + 'nationality' : fields.many2one('res.country', 'Nationality'), + 'birth_date' : fields.date('Birth Date'), + 'place_of_birth' : fields.char('Place of Birth', size=30), + 'marital_status' : fields.many2one('hr.employee.marital.status', 'Marital Status'), + 'children' : fields.integer('Number of children'), + 'contract_ids' : fields.one2many('hr.contract', 'employee_id', 'Contracts'), + } +hr_employee() + +#Contract wage type period name +class hr_contract_wage_type_period(osv.osv): + _name='hr.contract.wage.type.period' + _description='Wage Period' + _columns = { + 'name' : fields.char('Period Name', size=50, required=True, select=True), + } +hr_contract_wage_type_period() + +#Contract wage type (hourly, daily, monthly, ...) +class hr_contract_wage_type(osv.osv): + _name = 'hr.contract.wage.type' + _description = 'Wage Type' + _columns = { + 'name' : fields.char('Wage Type Name', size=50, required=True, select=True), + 'period_id' : fields.many2one('hr.contract.wage.type.period', 'Wage Period', required=True), + 'type' : fields.selection([('gross','Gross'), ('net','Net')], 'Type', required=True), + } + _defaults = { + 'type' : lambda *a : 'gross', + } +hr_contract_wage_type() + +class hr_contract(osv.osv): + _name = 'hr.contract' + _description = 'Contract' + _columns = { + 'name' : fields.char('Contract Name', size=30, required=True), + 'employee_id' : fields.many2one('hr.employee', 'Employee', required=True), + 'function' : fields.many2one('res.partner.function', 'Function'), + 'date_start' : fields.date('Start Date', required=True), + 'date_end' : fields.date('End Date'), + 'working_hours_per_day' : fields.integer('Working hours per day'), + 'wage_type_id' : fields.many2one('hr.contract.wage.type', 'Wage Type', required=True), + 'wage' : fields.float('Wage', required=True), + } + _defaults = { + 'date_start' : lambda *a : DateTime.now().strftime("%Y-%m-%d"), + 'working_hours_per_day' : lambda *a : 8, + } +hr_contract() + diff --git a/addons/hr_contract/hr_contract_view.xml b/addons/hr_contract/hr_contract_view.xml new file mode 100644 index 00000000000..21bd0b90893 --- /dev/null +++ b/addons/hr_contract/hr_contract_view.xml @@ -0,0 +1,198 @@ + + + + + hr.hr.employee.marital.status + hr.employee.marital.status + form + +
+ + + + +
+ + + hr.contract.wage.type.view.form + hr.contract.wage.type + form + +
+ + + + + +
+ + + hr.contract.wage.type.view.tree + hr.contract.wage.type + tree + + + + + + + + + action.hr.contract.wage.type + hr.contract.wage.type + form + tree,form + [] + + + + + hr.hr.employee.view.form2 + hr.employee + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+ + + hr.contract.type.view.form + hr.contract.type + form + +
+ + + + +
+ + + action.hr.employee.marital.status + hr.employee.marital.status + form + tree,form + + + + + + hr.contract.view.form + hr.contract + form + +
+ + + + + + + + + + + + + + + + + + + +
+ + + hr.contract.type.view.tree + hr.contract.type + tree + + + + + + + + + hr.contract.view.tree + hr.contract + tree + + + + + + + + + + + + + + + + + action.hr.contract + hr.contract + form + form,tree + [] + + + + +
+
+ + diff --git a/addons/hr_timesheet_sheet/__terp__.py b/addons/hr_timesheet_sheet/__terp__.py index ae3f0c808ae..d63816f219d 100644 --- a/addons/hr_timesheet_sheet/__terp__.py +++ b/addons/hr_timesheet_sheet/__terp__.py @@ -5,7 +5,7 @@ "category" : "Generic Modules/Human Resources", "website" : "http://tinyerp.com/module_hr.html", "description": "Timesheet by sheets", - "depends" : ["hr_timesheet", "hr_timesheet_project"], + "depends" : ["hr_timesheet", "hr_timesheet_project", "hr_timesheet_invoice"], "init_xml" : [], "demo_xml" : [], "update_xml" : ["hr_timesheet_sheet_view.xml", "hr_timesheet_workflow.xml"], diff --git a/addons/multi_company/project_view.xml b/addons/multi_company/project_view.xml index 5baab7f41ef..ebceaf3f576 100644 --- a/addons/multi_company/project_view.xml +++ b/addons/multi_company/project_view.xml @@ -4,7 +4,7 @@ project.project.form.multicompany - project.project.form + project.project @@ -15,7 +15,7 @@ project.task.form.multicompany - project.task.form + project.task