[MERGE] merged usability branch

bzr revid: qdp-launchpad@tinyerp.com-20100927111155-by1uikhvvx9xwwbp
This commit is contained in:
qdp-launchpad@tinyerp.com 2010-09-27 13:11:55 +02:00
commit 98f4e0a2b4
80 changed files with 1080 additions and 519 deletions

View File

@ -35,15 +35,15 @@ class audittrail_rule(osv.osv):
_description = "Audittrail Rule"
_columns = {
"name": fields.char("Rule Name", size=32, required=True),
"object_id": fields.many2one('ir.model', 'Object', required=True),
"object_id": fields.many2one('ir.model', 'Object', required=True, help="Select object for which you want to generate log."),
"user_id": fields.many2many('res.users', 'audittail_rules_users',
'user_id', 'rule_id', 'Users', help="if User is not added then it will applicable for all users"),
"log_read": fields.boolean("Log Reads"),
"log_write": fields.boolean("Log Writes"),
"log_unlink": fields.boolean("Log Deletes"),
"log_create": fields.boolean("Log Creates"),
"log_action": fields.boolean("Log Action"),
"log_workflow": fields.boolean("Log Workflow"),
"log_read": fields.boolean("Log Reads", help="Select this if you want to keep track of read/open on any record of the object of this rule"),
"log_write": fields.boolean("Log Writes", help="Select this if you want to keep track of modification on any record of the object of this rule"),
"log_unlink": fields.boolean("Log Deletes", help="Select this if you want to keep track of deletion on any record of the object of this rule"),
"log_create": fields.boolean("Log Creates",help="Select this if you want to keep track of creation on any record of the object of this rule"),
"log_action": fields.boolean("Log Action",help="Select this if you want to keep track of actions on the object of this rule"),
"log_workflow": fields.boolean("Log Workflow",help="Select this if you want to keep track of workflow on any record of the object of this rule"),
"state": fields.selection((("draft", "Draft"),
("subscribed", "Subscribed")),
"State", required=True),

View File

@ -44,6 +44,7 @@
'hr_installer.xml',
'hr_data.xml',
'board_hr_view.xml',
'board_hr_manager_view.xml',
],
'demo_xml': [
'hr_demo.xml',
@ -54,4 +55,4 @@
'active': False,
'certificate': '0086710558965',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- This board view will be complete by other hr_* modules-->
<record id="board_hr_manager_form" model="ir.ui.view">
<field name="name">board.hr.manager.form</field>
<field name="model">board.board</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="HR Manager Board">
<hpaned>
<child1>
</child1>
<child2>
</child2>
</hpaned>
</form>
</field>
</record>
<record id="open_board_hr_manager" model="ir.actions.act_window">
<field name="name">HR Manager Dashboard</field>
<field name="res_model">board.board</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="usage">menu</field>
<field name="view_id" ref="board_hr_manager_form"/>
</record>
</data>
</openerp>

View File

@ -107,10 +107,10 @@ class hr_employee(osv.osv):
_inherits = {'resource.resource': "resource_id"}
_columns = {
'country_id': fields.many2one('res.country', 'Nationality'),
'birthday': fields.date("Birthday"),
'birthday': fields.date("Date of Birth"),
'ssnid': fields.char('SSN No', size=32, help='Social Security Number'),
'sinid': fields.char('SIN No', size=32, help="Social Insurance Number"),
'otherid': fields.char('Other ID', size=32),
'identification_id': fields.char('Identification No', size=32),
'gender': fields.selection([('male', 'Male'),('female', 'Female')], 'Gender'),
'marital': fields.many2one('hr.employee.marital.status', 'Marital Status'),
'bank_account': fields.char('Bank Account', size=64),
@ -119,10 +119,10 @@ class hr_employee(osv.osv):
'address_id': fields.many2one('res.partner.address', 'Working Address'),
'address_home_id': fields.many2one('res.partner.address', 'Home Address'),
'work_phone': fields.related('address_id', 'phone', type='char', string='Work Phone', readonly=True),
'work_email': fields.related('address_id', 'email', type='char', size=240, string='Work E-mail', readonly=True),
'work_email': fields.related('address_id', 'email', type='char', size=240, string='Work E-mail'),
'work_location': fields.char('Office Location', size=32),
'notes': fields.text('Notes'),
'parent_id': fields.related('department_id', 'manager_id', relation='hr.employee', string='Manager', type='many2one', store=True, select=True),
'parent_id': fields.related('department_id', 'manager_id', relation='hr.employee', string='Manager', type='many2one', store=True, select=True, readonly=True, help="It is linked with manager of Department"),
'category_ids': fields.many2many('hr.employee.category', 'employee_category_rel','category_id','emp_id','Category'),
'child_ids': fields.one2many('hr.employee', 'parent_id', 'Subordinates'),
'resource_id': fields.many2one('resource.resource', 'Resource', ondelete='cascade', required=True),
@ -131,14 +131,29 @@ class hr_employee(osv.osv):
'photo': fields.binary('Photo')
}
def onchange_company(self, cr, uid, ids, company, context=None):
company_id = self.pool.get('res.company').browse(cr,uid,company)
for address in company_id.partner_id.address:
return {'value': {'address_id': address.id}}
return {'value':{}}
def onchange_department(self, cr, uid, ids, department_id, context=None):
manager = self.pool.get('hr.department').browse(cr, uid, department_id).manager_id.id
return {'value': {'parent_id':manager or False}}
def onchange_user(self, cr, uid, ids, user_id, context=None):
mail = self.pool.get('res.users').browse(cr,uid,user_id)
return {'value': {'work_email':mail.user_email}}
def _get_photo(self, cr, uid, context=None):
return open(os.path.join(
tools.config['addons_path'], 'hr/image', 'photo.png'),
'rb') .read().encode('base64')
_defaults = {
'active': 1,
'photo': _get_photo,
'address_id': lambda self,cr,uid,c: self.pool.get('res.partner.address').browse(cr, uid, uid, c).partner_id.id
}
def _check_recursion(self, cr, uid, ids, context=None):
@ -174,4 +189,4 @@ class hr_department(osv.osv):
hr_department()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -14,9 +14,9 @@
<field name="arch" type="xml">
<form string="department">
<group col="6" colspan="4">
<field colspan="4" name="name" select="1"/>
<field name="name" select="1"/>
<field name="parent_id"/>
<field colspan="4" name="manager_id" select="1"/>
<field name="manager_id" select="1"/>
<field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
</group>
<notebook colspan="4" >

View File

@ -22,12 +22,12 @@
<group colspan="4" col="8">
<group colspan="6" col="6">
<field colspan="6" name="name" />
<field name="user_id"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="user_id" on_change="onchange_user(user_id)"/>
<field name="company_id" widget="selection" groups="base.group_multi_company,base.group_extended" on_change="onchange_company(company_id)"/>
<field name="active" groups="base.group_extended"/>
<newline/>
<field name="department_id" widget="selection" on_change="onchange_department(department_id)"/>
<field name="parent_id" />
<field name="coach_id" />
</group>
<group colspan="2" col="1">
<field name="photo" widget='image' nolabel="1"/>
@ -39,7 +39,7 @@
<separator colspan="2" string="Social IDs"/>
<field name="ssnid"/>
<field name="sinid" groups="base.group_extended"/>
<field name="otherid" groups="base.group_extended"/>
<field name="identification_id" groups="base.group_extended"/>
</group>
<group col="2" colspan="2">
<separator string="Status" colspan="2"/>
@ -59,8 +59,8 @@
</group>
<group col="2" colspan="2">
<separator string="Position" colspan="2"/>
<field name="job_id" widget="selection" domain="[('state','!=','old')]"/>
<field name="department_id" widget="selection"/>
<field name="job_id" domain="[('state','!=','old')]"/>
<field name="coach_id" />
</group>
</page>
<page string="Categories">
@ -83,7 +83,8 @@
<tree string="Employees">
<field name="name"/>
<field name="work_phone"/>
<field name="work_email"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="work_email" invisible="1"/>
<field name="department_id"/>
<field name="job_id"/>
<field name="parent_id"/>
@ -98,7 +99,7 @@
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Employees">
<filter icon="terp-personal-" domain="[('active','=',False)]" string="Unactive" groups="base.group_extended"/>
<filter icon="terp-personal+" domain="[('active','=',True)]" string="Active" groups="base.group_extended"/>
<separator orientation="vertical" />
<field name="name"/>
<field name="department_id" widget="selection">
@ -113,6 +114,7 @@
<separator orientation="vertical" />
<filter string="Department" icon="terp-personal+" domain="[]" context="{'group_by':'department_id'}"/>
<filter string="Job" icon="terp-gtk-select-all" domain="[]" context="{'group_by':'job_id'}"/>
<filter string="Company" icon="terp-go-home" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
</group>
</search>
</field>
@ -148,7 +150,7 @@
<field name="help">The employee directory contains all data related to your employees: from their photo up to their hourly estimated costs for the timesheets. Employees are managed by departments and can be linked to users to manage their access rights.</field>
</record>
<menuitem action="open_view_employee_list_my" id="menu_open_view_employee_list_my" sequence="3" parent="menu_hr_main"/>
<menuitem action="open_view_employee_list_my" id="menu_open_view_employee_list_my" sequence="3" parent="menu_hr_main" groups="base.group_system,base.group_hr_manager,base.group_hr_user"/>
<!--
=======================

View File

@ -121,6 +121,17 @@
<field name="action">sign_out</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="property_rule_attendace" model="ir.rule">
<field name="name">Employee Attendance</field>
<field model="ir.model" name="model_id" ref="model_hr_attendance"/>
<field name="domain_force">[('employee_id.user_id','=',user.id)]</field>
<field name="groups" eval="[(6,0,[ref('base.group_user')])]"/>
</record>
<record id="property_rule_attendace_manager" model="ir.rule">
<field name="name">Manager Attendance</field>
<field model="ir.model" name="model_id" ref="model_hr_attendance"/>
<field name="domain_force">['|',('employee_id.user_id','=',user.id),('employee_id.parent_id.user_id','=',user.id )]</field>
<field name="groups" eval="[(6,0,[ref('base.group_hr_user'),ref('base.group_hr_manager')])]"/>
</record>
</data>
</openerp>

View File

@ -51,6 +51,7 @@
<field name="arch" type="xml">
<search string="Hr Attendance Search">
<filter icon="terp-stock_align_left_24" string="My Attendances" domain="[('employee_id.user_id.id', '=', uid)]" />
<separator orientation="vertical"/>
<filter icon="terp-go-today" string="Today" domain="[('name::date','=',current_date)]" />
<separator orientation="vertical"/>
<field name="employee_id" />
@ -59,6 +60,7 @@
<newline/>
<group expand="0" string="Group By...">
<filter name="employee" string="Employee" icon="terp-personal" domain="[]" context="{'group_by':'employee_id'}"/>
<separator orientation="vertical"/>
<filter string="Day" icon="terp-go-today" domain="[]" context="{'group_by':'day'}"/>
</group>
</search>
@ -76,7 +78,7 @@
</record>
<menuitem id="menu_hr_time_tracking" name="Time Tracking" parent="hr.menu_hr_root" sequence="3"/>
<menuitem action="open_view_attendance" id="menu_open_view_attendance" parent="menu_hr_time_tracking" groups="base.group_hr_manager,base.group_hr_user,base.group_hr_attendance,base.group_system" sequence="3"/>
<menuitem action="open_view_attendance" id="menu_open_view_attendance" parent="menu_hr_time_tracking" groups="base.group_hr_manager,base.group_hr_user,base.group_hr_attendance,base.group_system,base.group_user" sequence="3"/>
<record id="edit_attendance_reason" model="ir.ui.view">
<field name="name">hr.action.reason.form</field>
@ -111,8 +113,8 @@
<field name="view_id" ref="view_attendance_reason"/>
</record>
<menuitem sequence="9" id="hr.menu_open_view_attendance_reason_config" parent="hr.menu_hr_configuration" name="Leaves" />
<menuitem action="open_view_attendance_reason" id="menu_open_view_attendance_reason" parent="hr.menu_open_view_attendance_reason_config"/>
<menuitem sequence="2" id="hr.menu_open_view_attendance_reason_new_config" parent="hr.menu_hr_configuration" name="Time Tracking" />
<menuitem action="open_view_attendance_reason" id="menu_open_view_attendance_reason" parent="hr.menu_open_view_attendance_reason_new_config"/>
<record id="hr_attendance_employee" model="ir.ui.view">
<field name="name">hr.employee.form1</field>

View File

@ -10,3 +10,4 @@
"access_hr_department_attendance","hr.department attendance","hr.model_hr_department","base.group_hr_attendance",1,0,0,0
"access_hr_action_reason_system","hr.action.reason.system","model_hr_action_reason","base.group_system",1,1,1,1
"access_hr_attendance_system","hr.attendance.system","model_hr_attendance","base.group_system",1,0,0,0
"access_hr_attendance_employee","hr.attendance.employee","model_hr_attendance","base.group_user",1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
10 access_hr_department_attendance hr.department attendance hr.model_hr_department base.group_hr_attendance 1 0 0 0
11 access_hr_action_reason_system hr.action.reason.system model_hr_action_reason base.group_system 1 1 1 1
12 access_hr_attendance_system hr.attendance.system model_hr_attendance base.group_system 1 0 0 0
13 access_hr_attendance_employee hr.attendance.employee model_hr_attendance base.group_user 1 0 0 0

View File

@ -15,8 +15,8 @@
<separator colspan="4"/>
<group colspan="4" col="6">
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="gtk-go-back" string="Sign in" name="si_check" type="object"/>
<button icon="gtk-go-forward" string="Sign out" name="so_check" type="object"/>
<button icon="terp-gtk-jump-to-ltr" string="Sign in" name="si_check" type="object"/>
<button icon="terp-gtk-jump-to-rtl" string="Sign out" name="so_check" type="object"/>
</group>
</form>
</field>

View File

@ -95,11 +95,13 @@ class hr_contract(osv.osv):
_columns = {
'name': fields.char('Contract Reference', size=32, required=True),
'employee_id': fields.many2one('hr.employee', "Employee", required=True),
'department_id': fields.related('employee_id','department_id', string="Department", readonly=True),
'type_id': fields.many2one('hr.contract.type', "Contract Type"),
'department_id': fields.related('employee_id','department_id', type='many2one', relation='hr.department', string="Department", readonly=True),
'type_id': fields.many2one('hr.contract.type', "Contract Type", required=True),
'job_id': fields.many2one('hr.job', 'Job Title'),
'date_start': fields.date('Start Date', required=True),
'date_end': fields.date('End Date'),
'trial_date_start': fields.date('Trial Start Date'),
'trial_date_end': fields.date('Trial End Date'),
'working_hours': fields.many2one('resource.calendar','Working Schedule'),
'wage_type_id': fields.many2one('hr.contract.wage.type', 'Wage Type', required=True),
'wage': fields.float('Wage', digits=(16,2), required=True),

View File

@ -24,7 +24,20 @@
<field name="name">Monthly Net Wage</field>
<field name="type">net</field>
<field name="period_id" ref="hr_contract_wage_type_period_monthly"/>
</record>
</record>
<!-- Contract Types -->
<record id="hr_contract_type_emp" model="hr.contract.type">
<field name="name">Employee</field>
</record>
<record id="hr_contract_type_wrkr" model="hr.contract.type">
<field name="name">Worker</field>
</record>
<record id="hr_contract_type_sub" model="hr.contract.type">
<field name="name">Subcontractor</field>
</record>
</data>
</openerp>

View File

@ -49,7 +49,7 @@
</record>
<record id="action_hr_contract_wage_type" model="ir.actions.act_window">
<field name="name">Contract Wage Type</field>
<field name="name">Wage Type</field>
<field name="res_model">hr.contract.wage.type</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
@ -58,7 +58,7 @@
</record>
<menuitem id="next_id_56" name="Contract" parent="hr.menu_hr_management" sequence="5" groups="base.group_system"/>
<menuitem action="action_hr_contract_wage_type" id="hr_menu_contract_wage_type" parent="next_id_56"/>
<menuitem action="action_hr_contract_wage_type" id="hr_menu_contract_wage_type" parent="next_id_56" sequence="7"/>
<record id="hr_contract_wage_type_period_view_form" model="ir.ui.view">
<field name="name">hr.contract.wage.type.period.view.form</field>
@ -101,7 +101,7 @@
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<page string="Notes" position="before">
<page string="Personal Information" position="after">
<page string="Miscellaneous">
<group colspan="2" col="2">
<separator string="Personal Info" colspan="2"/>
@ -133,7 +133,7 @@
<field name="type">form</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<field name="department_id" position="after">
<field name="parent_id" position="after">
<field name="contract_id"/>
</field>
</field>
@ -154,8 +154,11 @@
</group>
<newline/>
<group expand="0" string="Group By..." colspan="4" col="20">
<filter string="Wage Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'wage_type_id'}"/>
<filter string="Contract Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'type_id'}"/>
<filter string="Working Schedule" icon="terp-personal+" domain="[]" context="{'group_by':'working_hours'}"/>
<filter string="Current" icon="terp-stock_symbol-selection"
domain="[('date_end','&gt;=', time.strftime('%%Y-%%m-%%d'))]"
context="{'group_by':'date_end'}"/>
</group>
</search>
</field>
@ -182,7 +185,10 @@
<field name="date_start" />
<field name="date_end" />
<field name="working_hours"/>
</group>
<separator colspan="2" string="Trial Period"/>
<field name="trial_date_start" />
<field name="trial_date_end" />
</group>
<group col="2" colspan="2">
<separator colspan="2" string="Advantages"/>
<field name="advantages_net"/>
@ -205,13 +211,14 @@
<tree string="Contracts">
<field name="name"/>
<field name="employee_id"/>
<field name="type_id"/>
<field name="job_id"/>
<field name="department_id"/>
<field name="working_hours"/>
<field name="date_start"/>
<field name="date_end"/>
<field name="working_hours"/>
<field name="wage_type_id"/>
<field name="wage"/>
<field name="wage_type_id" invisible="1"/>
<field name="wage" invisible="1"/>
</tree>
</field>
</record>
@ -268,8 +275,8 @@
<field name="search_view_id" ref="hr_contract_type_view_search"/>
</record>
<menuitem action="action_hr_contract_type" id="hr_menu_contract_type" parent="next_id_56"/>
<menuitem action="action_hr_contract" id="hr_menu_contract" parent="hr.menu_hr_main" name="Contracts" sequence="4"/>
<menuitem action="action_hr_contract_type" id="hr_menu_contract_type" parent="next_id_56" sequence="6"/>
<menuitem action="action_hr_contract" id="hr_menu_contract" parent="hr.menu_hr_main" name="Contracts" sequence="4" groups="base.group_system,base.group_hr_manager,base.group_hr_contract"/>
<!-- Contracts Button on Employee Form -->
<act_window domain="[('employee_id', '=', active_id)]" id="act_hr_employee_2_hr_contract" name="Contracts" res_model="hr.contract" src_model="hr.employee"/>

View File

@ -12,7 +12,9 @@
"access_hr_contract_wage_type_system","hr.contract.wage.type.system","model_hr_contract_wage_type","base.group_system",1,1,1,1
"access_hr_contract_wage_type_period_system","hr.contract.wage.type.period.system","model_hr_contract_wage_type_period","base.group_system",1,1,1,1
"access_hr_contract_type_system","hr.contract.type.system","model_hr_contract_type","base.group_system",1,1,1,1
"access_hr_contract_system","hr.contract.system","model_hr_contract","base.group_system",1,0,0,0
"access_hr_contract_system","hr.contract.system","model_hr_contract","base.group_system",1,1,1,1
"access_hr_employee_category_contract","hr.employee.category.contract","hr.model_hr_employee_category","base.group_hr_contract",1,1,1,1
"access_hr_department_contract","hr.department.contract","hr.model_hr_department","base.group_hr_contract",1,1,1,1
"access_hr_contract_manager","hr.contract.manager","model_hr_contract","base.group_hr_manager",1,0,0,0
"access_hr_contract_manager","hr.contract.manager","model_hr_contract","base.group_hr_manager",1,1,1,1
"access_hr_contract_employee","hr.contract.employee","model_hr_contract","base.group_user",1,0,0,0
"access_hr_contract_type_manager","hr.contract.type.manager","model_hr_contract_type","base.group_hr_manager",1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
12 access_hr_contract_wage_type_system hr.contract.wage.type.system model_hr_contract_wage_type base.group_system 1 1 1 1
13 access_hr_contract_wage_type_period_system hr.contract.wage.type.period.system model_hr_contract_wage_type_period base.group_system 1 1 1 1
14 access_hr_contract_type_system hr.contract.type.system model_hr_contract_type base.group_system 1 1 1 1
15 access_hr_contract_system hr.contract.system model_hr_contract base.group_system 1 0 1 0 1 0 1
16 access_hr_employee_category_contract hr.employee.category.contract hr.model_hr_employee_category base.group_hr_contract 1 1 1 1
17 access_hr_department_contract hr.department.contract hr.model_hr_department base.group_hr_contract 1 1 1 1
18 access_hr_contract_manager hr.contract.manager model_hr_contract base.group_hr_manager 1 0 1 0 1 0 1
19 access_hr_contract_employee hr.contract.employee model_hr_contract base.group_user 1 0 0 0
20 access_hr_contract_type_manager hr.contract.type.manager model_hr_contract_type base.group_hr_manager 1 1 1 1

View File

@ -41,7 +41,10 @@
advantages_net: 0.0
date_end: '2011-05-18'
date_start: '2010-05-18'
trial_date_end: '2010-03-01'
trial_date_start: '2010-04-30'
name: contract1
wage: 1.0
wage_type_id: hr_contract_wage_type_monthlygrosswage0
type_id: hr_contract_type_emp
working_hours: resource.timesheet_group1

View File

@ -33,7 +33,7 @@
in which various surveys can be created and it can be defined which
level of employee hierarchy fills what and final review and evaluation
is done by the manager.Every evaluation filled by the employees can be viewed
in the form of.Implements a dashboard for My Current Evaluations
in the form of.Implements a dashboard for My Current Evaluations
""",
"init_xml": [],
"demo_xml": ["hr_evaluation_demo.xml",
@ -43,7 +43,8 @@
"security/hr_evaluation_security.xml",
"wizard/hr_evaluation_mail_view.xml",
"hr_evaluation_view.xml",
"report/hr_evaluation_report_view.xml"
"report/hr_evaluation_report_view.xml",
"board_hr_evaluation_view.xml"
],
"test": ["test/test_hr_evaluation.yml"],
"active": False,

View File

@ -2,12 +2,12 @@
<openerp>
<data>
<record id="act_hr_evaluation_tree" model="ir.actions.act_window">
<field name="name">My Current Evaluations</field>
<field name="name">My Evaluation Remaining</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">hr_evaluation.evaluation</field>
<field name="view_type">form</field>
<field name="view_id" eval="False"/>
<field name="domain">[('state','!=','done'),('create_uid','=',uid)]</field>
<field name="domain">[('state','in',('wait', 'progress')),('create_uid','=',uid)]</field>
<field name="search_view_id" ref="hr_evaluation.view_hr_evaluation_tree"/>
</record>
@ -18,9 +18,15 @@
<field name="type">form</field>
<field name="arch" type="xml">
<xpath expr="/form/hpaned/child1" position="inside">
<action colspan="4" height="220" name="%(act_hr_evaluation_tree)d" string="My Current Evaluations" width="510"/>
<action colspan="4" height="220" name="%(act_hr_evaluation_tree)d" string="My Evaluation Remaining" width="510"/>
</xpath>
</field>
</record>
<menuitem
action="hr.open_board_hr"
icon="terp-graph"
id="base.menu_hr_project"
parent="base.menu_hr_dasboard"
sequence="4"/>
</data>
</openerp>

View File

@ -34,7 +34,7 @@ class hr_evaluation_plan(osv.osv):
'company_id': fields.many2one('res.company', 'Company', required=True),
'phase_ids': fields.one2many('hr_evaluation.plan.phase', 'plan_id', 'Evaluation Phases'),
'month_first': fields.integer('First Evaluation After'),
'month_next': fields.integer('Next Evaluation After'),
'month_next': fields.integer('After the Date of Start'),
'active': fields.boolean('Active')
}
_defaults = {
@ -67,10 +67,10 @@ class hr_evaluation_plan_phase(osv.osv):
'send_anonymous_employee': fields.boolean('Anonymous Summary',
help="Send an anonymous summary to the employee"),
'wait': fields.boolean('Wait Previous Phases',
help="Check this box if you want to wait that all preceeding phases " +
help="Check this box if you want to wait that all preceding phases " +
"are finished before launching this phase."),
'mail_feature': fields.boolean('Send mail for this phase', help="Check this box if you want to send mail to employees"+
"coming under this phase"),
" coming under this phase"),
'mail_body': fields.text('Email'),
'email_subject':fields.text('char')
}
@ -161,13 +161,13 @@ class hr_evaluation(osv.osv):
('2','Meet expectations'),
('3','Exceeds expectations'),
('4','Significantly exceeds expectations'),
], "Overall Rating", help="This is the overall rating on that summarize the evaluation"),
], "Appreciation", help="This is the appreciation on that summarize the evaluation"),
'survey_request_ids': fields.one2many('hr.evaluation.interview','evaluation_id','Appraisal Forms'),
'plan_id': fields.many2one('hr_evaluation.plan', 'Plan', required=True),
'state': fields.selection([
('draft','Draft'),
('wait','Plan In Progress'),
('progress','Final Validation'),
('progress','Waiting Appreciation'),
('done','Done'),
('cancel','Cancelled'),
], 'State', required=True, readonly=True),
@ -220,8 +220,8 @@ class hr_evaluation(osv.osv):
elif phase.action == "self":
childs = [evaluation.employee_id]
for child in childs:
if not child.user_id:
continue
# if not child.user_id:
# continue
int_id = hr_eval_inter_obj.create(cr, uid, {
'evaluation_id': evaluation.id,
@ -284,6 +284,7 @@ survey_request()
class hr_evaluation_interview(osv.osv):
_name = 'hr.evaluation.interview'
_inherits = {'survey.request': 'request_id'}
_rec_name = 'request_id'
_description = 'Evaluation Interview'
_columns = {
'request_id': fields.many2one('survey.request','Request_id', ondelete='cascade', required=True),
@ -293,7 +294,19 @@ class hr_evaluation_interview(osv.osv):
_defaults = {
'is_evaluation': True,
}
def name_get(self, cr, uid, ids, context=None):
if context is None:
context = {}
if not len(ids):
return []
reads = self.browse(cr, uid, ids, context=context)
res = []
for record in reads:
name = record.request_id.survey_id.title
res.append((record['id'], name))
return res
def survey_req_waiting_answer(self, cr, uid, ids, context=None):
if context is None:
context = {}

View File

@ -9,6 +9,7 @@
<field name="type" ref="survey.survey_type1"/>
<field name="responsible_id" ref="base.user_demo"/>
<field name="response_user">5</field>
<field name="state">open</field>
</record>
</data>
@ -1610,6 +1611,19 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="'run_employee_evaluation'" name="function" />
<field eval="'(False,)'" name="args" />
</record>
<record id="property_rule_evaluation" model="ir.rule">
<field name="name">Employee Evaluation</field>
<field model="ir.model" name="model_id" ref="model_hr_evaluation_evaluation"/>
<field name="domain_force">[('employee_id.user_id','=',user.id)]</field>
<field name="groups" eval="[(6,0,[ref('base.group_user')])]"/>
</record>
<record id="property_rule_evaluation_manager" model="ir.rule">
<field name="name">Manager Evaluation</field>
<field model="ir.model" name="model_id" ref="model_hr_evaluation_evaluation"/>
<field name="domain_force">['|',('employee_id.user_id','=',user.id),('employee_id.parent_id.user_id','=',user.id )]</field>
<field name="groups" eval="[(6,0,[ref('base.group_hr_user'),ref('base.group_hr_manager')])]"/>
</record>
</data>
</openerp>

View File

@ -26,13 +26,14 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Evaluation Plan">
<group col="6" colspan="4">
<group col="8" colspan="4">
<field name="name" select="1"/>
<field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
<field name="active"/>
<field name="month_first"/>
<field name="month_next"/>
<label string="(months)" align="0.0"/>
<newline/>
<field name="active"/>
</group>
<notebook colspan="4">
<page string="Evaluation Phases">
@ -72,7 +73,7 @@
<field name="model">hr_evaluation.plan.phase</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Evaluation Plan Phase">
<form string="Evaluation Plan Phases">
<notebook>
<page string="General">
<field name="plan_id" invisible="1"/>
@ -84,7 +85,7 @@
<group col="4" colspan="4">
<separator string="Action to Perform" colspan="4"/>
<field name="action"/>
<field name="survey_id"/>
<field name="survey_id" domain="[('state','=','open')]"/>
</group>
<group col="4" colspan="4">
<group col="4" colspan="2">
@ -125,7 +126,7 @@
<field name="model">hr_evaluation.plan.phase</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Evaluation Plan Phase" editable="bottom" >
<tree string="Evaluation Plan Phases" editable="bottom" >
<field name="sequence"/>
<field name="name"/>
<field name="action"/>
@ -184,7 +185,7 @@
<field name="state"/>
<button name="button_plan_in_progress" string="Start Evaluation" states="draft" type="object"
icon="gtk-execute"/>
<button name="button_final_validation" string="Final Validation" states="wait" type="object"
<button name="button_final_validation" string="Validate Evaluation" states="wait" type="object"
icon="gtk-execute"/>
<button name="button_done" string="Done" states="progress" type="object"
icon="gtk-jump-to"/>
@ -204,7 +205,7 @@
<field name="employee_id"/>
<field name="plan_id"/>
<field name="date"/>
<field name="progress" widget="progressbar"/>
<!--field name="progress" widget="progressbar"/-->
<field name="rating"/>
<field name="state"/>
</tree>
@ -230,40 +231,40 @@
<field name="arch" type="xml">
<search string="Search Evaluation">
<group col='10' colspan='4'>
<filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]"/>
<filter icon="terp-check" string="In progress" domain="[('state','=','wait')]"/>
<filter icon="terp-dialog-close" string="Final Step" domain="[('state','=','progress')]"/>
<filter icon="terp-check" string="Current" domain="[('state','=','wait'))]" help="Evaluations that are in waiting state"/>
<filter icon="terp-camera_test" string="In progress" domain="[('state','=','progress')]" help="Evaluations that are in progress state"/>
<separator orientation="vertical"/>
<filter icon="terp-go-week" string="7 Days" help="Evaluations to close within the next 7 days"
domain="[('date', '&gt;=', (datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]" />
<filter icon="terp-gnome-cpu-frequency-applet+" string="Overpassed"
help="Evaluations that overpassed the deadline" domain="[('date','&gt;=',str(datetime.date.today()))]" />
<separator orientation="vertical"/>
<field name="employee_id" />
<field name="plan_id" widget="selection" />
</group>
<newline/>
<group expand='0' string='Group by...'>
<filter string='Employee' icon="terp-personal" domain="[]" context="{'group_by' : 'employee_id'}" />
<filter string='Plan' icon="terp-stock_align_left_24" domain="[]" context="{'group_by' : 'plan_id'}" />
<filter string='State' icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by' : 'state'}" />
<separator orientation="vertical"/>
<filter string='Date' icon="terp-go-month" domain="[]" context="{'group_by' : 'date'}" />
<separator orientation="vertical"/>
<filter icon="terp-gnome-cpu-frequency-applet+" string="Overpassed Deadline"
help="Evaluations that overpassed the deadline" domain="[('date','&lt;=',(datetime.date.today()).strftime('%%Y-%%m-%%d'))]" />
<separator orientation="vertical"/>
<field name="employee_id" />
<field name="plan_id" widget="selection" />
</group>
<newline/>
<group expand='0' string='Group by...'>
<filter string='Employee' icon="terp-personal" domain="[]" context="{'group_by' : 'employee_id'}" />
<filter string='Plan' icon="terp-stock_align_left_24" domain="[]" context="{'group_by' : 'plan_id'}" />
<filter string='State' icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by' : 'state'}" />
<separator orientation="vertical"/>
<filter string='Date' icon="terp-go-month" domain="[]" context="{'group_by' : 'date'}" />
</group>
</search>
</field>
</record>
<record model="ir.actions.act_window" id="open_view_hr_evaluation_tree">
<field name="name">Evaluation</field>
<field name="name">Evaluations</field>
<field name="res_model">hr_evaluation.evaluation</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,graph</field>
<field name="search_view_id" ref="hr_evaluation.evaluation_search"/>
<field name="help">Each employee can be assigned to an evaluation plan. These plans define the frequency and the way you manage your periodic personnal evalautions. You will be able to define steps and attach interview forms to each step. OpenERP manages all kind of evaluations: bottom-up, top-down, self evaluation and final evaluation by the manager.</field>
<field name="help">Each employee can be assigned to an evaluation plan. These plans define the frequency and the way you manage your periodic personnal evaluation. You will be able to define steps and attach interview forms to each step. OpenERP manages all kind of evaluations: bottom-up, top-down, self evaluation and final evaluation by the manager.</field>
</record>
<menuitem name="Evaluation" parent="menu_eval_hr" id="menu_open_view_hr_evaluation_tree"
<menuitem name="Evaluations" parent="menu_eval_hr" id="menu_open_view_hr_evaluation_tree"
action="open_view_hr_evaluation_tree"/>
<record model="ir.ui.view" id="view_hr_evaluation_interview_form">
@ -299,7 +300,7 @@
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Interview Evaluation">
<field name="date_deadline"/>
<field name="date_deadline" string="Deadline Date"/>
<field name="survey_id"/>
<field name="user_id" string="Interviewer"/>
<field name="user_to_review_id"/>
@ -327,26 +328,57 @@
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="Survey" icon="terp-personal" domain="[]" context="{'group_by':'survey_id'}"/>
<filter string="Interviewer" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<separator orientation="vertical"/>
<filter string="Survey" icon="terp-stock_align_left_24" domain="[]" context="{'group_by':'survey_id'}"/>
<separator orientation="vertical"/>
<filter string="State" name="group_state" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
</group>
</search>
</field>
</record>
<record id="view_evaluation_calendar" model="ir.ui.view">
<field name="name">Interview Request</field>
<field name="model">hr.evaluation.interview</field>
<field name="type">calendar</field>
<field name="arch" type="xml">
<calendar string="Interview Request" color="user_to_review_id" date_start="date_deadline">
<field name="request_id"/>
</calendar>
</field>
</record>
<record model="ir.actions.act_window" id="action_hr_evaluation_interview_tree">
<field name="name">Interview Requests</field>
<field name="res_model">hr.evaluation.interview</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_hr_evaluation_interview_form"/>
<field name="domain">[('is_evaluation' ,'=', True)]</field>
<field name="context">{"search_default_todo":1,"search_default_user_id":uid}</field>
<field name="search_view_id" ref="view_hr_evaluation_interview_search"/>
<field name="help">Interview Requests are generated automatically by OpenERP according to employees evaluation plan. Each user receives automatic emails and requests to perform evaluation of their collegues periodically.</field>
</record>
<record model="ir.actions.act_window.view" id="hr_evaluation_interview_tree">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="view_hr_evaluation_interview_tree"/>
<field name="act_window_id" ref="action_hr_evaluation_interview_tree"/>
</record>
<record model="ir.actions.act_window.view" id="hr_evaluation_interview_form">
<field name="sequence" eval="2"/>
<field name="view_mode">form</field>
<field name="view_id" ref="view_hr_evaluation_interview_form"/>
<field name="act_window_id" ref="action_hr_evaluation_interview_tree"/>
</record>
<record model="ir.actions.act_window.view" id="action_view_evaluation_calendar">
<field name="sequence" eval="3"/>
<field name="view_mode">calendar</field>
<field name="view_id" ref="view_evaluation_calendar"/>
<field name="act_window_id" ref="action_hr_evaluation_interview_tree"/>
</record>
<menuitem name="Interview Requests" parent="menu_eval_hr" id="menu_open_hr_evaluation_interview_requests"
action="action_hr_evaluation_interview_tree"/>
<menuitem name="Evaluation Reminders" parent="menu_eval_hr" id="menu_eval_send_mail"

View File

@ -29,6 +29,9 @@ class hr_evaluation_report(osv.osv):
_rec_name = 'date'
_columns = {
'create_date': fields.date('Create Date', readonly=True),
'delay_date':fields.float('Delay to Start', digits=(16,2),readonly=True),
'overpass_delay':fields.float('Overpassed Deadline', digits=(16,2), readonly=True),
'progress_bar' : fields.float("Progress"),
'day': fields.char('Day', size=128, readonly=True),
'deadline': fields.date("Deadline", readonly=True),
'request_id': fields.many2one('survey.request', 'Request_id', readonly=True),
@ -73,7 +76,10 @@ class hr_evaluation_report(osv.osv):
to_char(s.create_date, 'YYYY') as year,
to_char(s.create_date, 'MM') as month,
count(l.*) as nbr,
s.state
s.state,
s.progress as progress_bar,
avg(extract('epoch' from age(s.create_date,CURRENT_DATE)))/(3600*24) as delay_date,
avg(extract('epoch' from age(s.date,CURRENT_DATE)))/(3600*24) as overpass_delay
from
hr_evaluation_interview l
LEFT JOIN
@ -90,6 +96,7 @@ class hr_evaluation_report(osv.osv):
s.date_close,
l.request_id,
s.rating,
s.progress,
s.plan_id
)
""")

View File

@ -19,6 +19,9 @@
<field name="month" invisible="1"/>
<field name="rating" invisible="1"/>
<field name="nbr" sum="# of Requests"/>
<field name="progress_bar" widget="progressbar"/>
<field name="delay_date"/>
<field name="overpass_delay"/>
<field name="state" invisible="1"/>
</tree>
</field>
@ -44,15 +47,13 @@
<field name="arch" type="xml">
<search string="Evaluations Analysis">
<group>
<filter icon="terp-go-year" string="365 Days"
domain="[('create_date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('create_date', '&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]" help="Tasks performed in last 365 days"/>
<filter icon="terp-go-month" string="30 Days" name="month" domain="[('create_date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('create_date','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]" help="Tasks performed in last 30 days"/>
<filter icon="terp-go-week" string=" 7 Days " separator="1"
domain="[('create_date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('create_date','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]" help="Tasks during last 7 days"/>
<filter icon="terp-go-year" string=" Year "
domain="[('create_date','&lt;=', time.strftime('%%Y-%%m-%%d')),('create_date','&gt;=',time.strftime('%%Y-01-01'))]" help="Evaluation done in current year"/>
<filter icon="terp-go-month" string=" Month " name="month" domain="[('create_date','&lt;=', time.strftime('%%Y-%%m-%%d')),('create_date','&gt;=',time.strftime('%%Y-%%m-01'))]" help="Evaluation done in current month"/>
<filter icon="terp-go-month" string=" Month-1 " separator="1"
domain="[('create_date','&lt;=', (datetime.date (int(time.strftime('%%Y')), datetime.date.today().month, 1) - datetime.timedelta (days = 1)).strftime('%%Y-%%m-%%d')),('create_date','&gt;=',(datetime.date (int(time.strftime('%%Y')), datetime.date.today().month-1, 1)).strftime('%%Y-%%m-%%d'))]" help="Evaluation done in last month"/>
<separator orientation="vertical"/>
<filter string="Draft" icon="terp-document-new" domain="[('state','=','draft')]"
help = "Draft Evaluations"/>
<filter string="Plan In Progress" icon="terp-camera_test" domain="[('state', '=' ,'wait')]"
<filter string="In Progress" icon="terp-camera_test" domain="[('state', '=' ,'wait')]"
help = "In progress Evaluations"/>
<filter string="Final Validation" icon="terp-check" domain="[('state','=','progress')]"
help = "Final Validation Evaluations"/>
@ -62,24 +63,25 @@
<field name="plan_id" widget="selection"/>
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="Employee" name="employee" icon="terp-personal" context="{'group_by':'employee_id'}"/>
<filter string="Rating" icon="terp-rating-rated" context="{'group_by':'rating'}"/>
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="rating"/>
<newline/>
<field name="deadline"/>
<separator orientation="vertical"/>
<filter string="Plan" icon="terp-stock_align_left_24" context="{'group_by':'plan_id'}"/>
<filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
<separator orientation="vertical"/>
<filter string="Day" icon="terp-go-today" context="{'group_by':'day'}"/>
<filter string="Month" icon="terp-go-month" context="{'group_by':'create_date'}"/>
<filter string="Year" icon="terp-go-month" context="{'group_by':'year'}"/>
<field name="state"/>
</group>
<newline/>
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="rating"/>
<separator orientation="vertical"/>
<field name="deadline"/>
<separator orientation="vertical"/>
<field name="state"/>
<group expand="1" string="Group By...">
<filter string="Employee" name="employee" icon="terp-personal" context="{'group_by':'employee_id'}"/>
<separator orientation="vertical"/>
<filter string="Plan" icon="terp-stock_align_left_24" context="{'group_by':'plan_id'}"/>
<filter string="Appreciation" icon="terp-rating-rated" context="{'group_by':'rating'}"/>
<separator orientation="vertical"/>
<filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
<separator orientation="vertical"/>
<filter string="Day" icon="terp-go-today" context="{'group_by':'day'}" help="Group by create Date"/>
<filter string="Month" icon="terp-go-month" context="{'group_by':'create_date'}" help="Group by month of create Date"/>
<filter string="Year" icon="terp-go-month" context="{'group_by':'year'}" help="Group by year of create Date"/>
</group>
</search>
</field>

View File

@ -2,9 +2,9 @@
"access_hr_evaluation_evaluation_user","hr_evaluation.evaluation.user","model_hr_evaluation_evaluation","base.group_hr_user",1,1,1,1
"access_hr_evaluation_evaluation_manager","hr_evaluation.evaluation.manager","model_hr_evaluation_evaluation","base.group_hr_manager",1,1,1,1
"access_hr_evaluation_plan_user","hr_evaluation.plan.user","model_hr_evaluation_evaluation","base.group_hr_user",1,0,0,0
"access_hr_evaluation_plan_manager","hr_evaluation.plan.manager","model_hr_evaluation_plan","base.group_hr_manager",1,0,0,0
"access_hr_evaluation_plan_manager","hr_evaluation.plan.manager","model_hr_evaluation_plan","base.group_hr_manager",1,1,1,1
"access_hr_evaluation_plan_phase_user","hr_evaluation.plan.phase.user","model_hr_evaluation_plan_phase","base.group_hr_user",1,0,0,0
"access_hr_evaluation_plan_phase_manager","hr_evaluation.plan.phase.manager","model_hr_evaluation_plan_phase","base.group_hr_manager",1,0,0,0
"access_hr_evaluation_plan_phase_manager","hr_evaluation.plan.phase.manager","model_hr_evaluation_plan_phase","base.group_hr_manager",1,1,1,1
"access_hr_evaluation_interview_user","hr.evaluation.interview.user","model_hr_evaluation_interview","base.group_hr_user",1,1,1,1
"access_hr_evaluation_interview_manager","hr.evaluation.interview.manager","model_hr_evaluation_interview","base.group_hr_manager",1,1,1,1
"access_hr_evaluation_report","hr.evaluation.report","model_hr_evaluation_report","base.group_hr_manager",1,1,1,1
@ -12,6 +12,10 @@
"access_hr_evaluation_plan_phase_system","hr_evaluation.plan.phase.system","model_hr_evaluation_plan_phase","base.group_system",1,1,1,1
"access_hr_evaluation_evaluation_system","hr_evaluation.evaluation.system","model_hr_evaluation_evaluation","base.group_system",1,0,0,0
"access_hr_evaluation_interview_system","hr.evaluation.interview.system","model_hr_evaluation_interview","base.group_system",1,0,0,0
"access_hr_evaluation_evaluation_employee","hr_evaluation.evaluation.employee","model_hr_evaluation_evaluation","base.group_user",1,0,0,0
"access_hr_evaluation_interview_employee","hr.evaluation.interview.employee","model_hr_evaluation_interview","base.group_user",1,0,0,0
"access_hr_evaluation_user","hr_evaluation.user","model_hr_evaluation_plan","base.group_hr_user",1,1,1,1
"access_hr_evaluation_employee","hr_evaluation.employee","model_hr_evaluation_plan","base.group_user",1,0,0,0
"access_survey_type_hr_manager","survey.type","survey.model_survey_type","base.group_hr_manager",1,1,1,1
"access_survey_hr_manager","survey.hr.manager","survey.model_survey","base.group_hr_manager",1,1,1,1
"access_survey_history_manager","survey.history","survey.model_survey_history","base.group_hr_manager",1,1,1,1
@ -28,4 +32,11 @@
"access_survey_answer_hr_user","survey.answer.hr.user","survey.model_survey_answer","base.group_hr_user",1,1,1,0
"access_survey_response_answer_hr_user","survey.response.answer.hr.user","survey.model_survey_response_answer","base.group_hr_user",1,1,1,0
"access_survey_type_hr_user","survey.type.hr.user","survey.model_survey_type","base.group_hr_user",1,1,1,0
"access_survey_question_hr_user","survey.question.hr.user","survey.model_survey_question","base.group_hr_user",1,1,1,0
"access_survey_question_hr_user","survey.question.hr.user","survey.model_survey_question","base.group_hr_user",1,1,1,0
"access_survey_page_hr_user","survey.page.hr.user","survey.model_survey_page","base.group_hr_user",1,1,1,1
"access_survey_response_hr_user","survey.response.hr.user","survey.model_survey_response","base.group_hr_user",1,1,1,0
"access_survey_history_hr_user","survey.history.hr.user","survey.model_survey_history","base.group_hr_user",1,1,1,0
"access_survey_request_hr_user","survey.request.hr.user","survey.model_survey_request","base.group_hr_user",1,1,1,0
"access_survey_question_column_heading_hr_user","survey.question.column.heading.hr.user","survey.model_survey_question_column_heading","base.group_hr_user",1,0,0,0
"access_survey_response_line_hr_user","survey.response.line.hr.user","survey.model_survey_response_line","base.group_hr_user",1,1,1,0
"access_survey_tbl_column_heading_hr_user","survey.tbl.column.heading.hr.user","survey.model_survey_tbl_column_heading","base.group_hr_user",1,1,1,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_hr_evaluation_evaluation_user hr_evaluation.evaluation.user model_hr_evaluation_evaluation base.group_hr_user 1 1 1 1
3 access_hr_evaluation_evaluation_manager hr_evaluation.evaluation.manager model_hr_evaluation_evaluation base.group_hr_manager 1 1 1 1
4 access_hr_evaluation_plan_user hr_evaluation.plan.user model_hr_evaluation_evaluation base.group_hr_user 1 0 0 0
5 access_hr_evaluation_plan_manager hr_evaluation.plan.manager model_hr_evaluation_plan base.group_hr_manager 1 0 1 0 1 0 1
6 access_hr_evaluation_plan_phase_user hr_evaluation.plan.phase.user model_hr_evaluation_plan_phase base.group_hr_user 1 0 0 0
7 access_hr_evaluation_plan_phase_manager hr_evaluation.plan.phase.manager model_hr_evaluation_plan_phase base.group_hr_manager 1 0 1 0 1 0 1
8 access_hr_evaluation_interview_user hr.evaluation.interview.user model_hr_evaluation_interview base.group_hr_user 1 1 1 1
9 access_hr_evaluation_interview_manager hr.evaluation.interview.manager model_hr_evaluation_interview base.group_hr_manager 1 1 1 1
10 access_hr_evaluation_report hr.evaluation.report model_hr_evaluation_report base.group_hr_manager 1 1 1 1
12 access_hr_evaluation_plan_phase_system hr_evaluation.plan.phase.system model_hr_evaluation_plan_phase base.group_system 1 1 1 1
13 access_hr_evaluation_evaluation_system hr_evaluation.evaluation.system model_hr_evaluation_evaluation base.group_system 1 0 0 0
14 access_hr_evaluation_interview_system hr.evaluation.interview.system model_hr_evaluation_interview base.group_system 1 0 0 0
15 access_hr_evaluation_evaluation_employee hr_evaluation.evaluation.employee model_hr_evaluation_evaluation base.group_user 1 0 0 0
16 access_hr_evaluation_interview_employee hr.evaluation.interview.employee model_hr_evaluation_interview base.group_user 1 0 0 0
17 access_hr_evaluation_user hr_evaluation.user model_hr_evaluation_plan base.group_hr_user 1 1 1 1
18 access_hr_evaluation_employee hr_evaluation.employee model_hr_evaluation_plan base.group_user 1 0 0 0
19 access_survey_type_hr_manager survey.type survey.model_survey_type base.group_hr_manager 1 1 1 1
20 access_survey_hr_manager survey.hr.manager survey.model_survey base.group_hr_manager 1 1 1 1
21 access_survey_history_manager survey.history survey.model_survey_history base.group_hr_manager 1 1 1 1
32 access_survey_answer_hr_user survey.answer.hr.user survey.model_survey_answer base.group_hr_user 1 1 1 0
33 access_survey_response_answer_hr_user survey.response.answer.hr.user survey.model_survey_response_answer base.group_hr_user 1 1 1 0
34 access_survey_type_hr_user survey.type.hr.user survey.model_survey_type base.group_hr_user 1 1 1 0
35 access_survey_question_hr_user survey.question.hr.user survey.model_survey_question base.group_hr_user 1 1 1 0
36 access_survey_page_hr_user survey.page.hr.user survey.model_survey_page base.group_hr_user 1 1 1 1
37 access_survey_response_hr_user survey.response.hr.user survey.model_survey_response base.group_hr_user 1 1 1 0
38 access_survey_history_hr_user survey.history.hr.user survey.model_survey_history base.group_hr_user 1 1 1 0
39 access_survey_request_hr_user survey.request.hr.user survey.model_survey_request base.group_hr_user 1 1 1 0
40 access_survey_question_column_heading_hr_user survey.question.column.heading.hr.user survey.model_survey_question_column_heading base.group_hr_user 1 0 0 0
41 access_survey_response_line_hr_user survey.response.line.hr.user survey.model_survey_response_line base.group_hr_user 1 1 1 0
42 access_survey_tbl_column_heading_hr_user survey.tbl.column.heading.hr.user survey.model_survey_tbl_column_heading base.group_hr_user 1 1 1 0

View File

@ -25,7 +25,7 @@ class hr_evaluation_reminder(osv.osv_memory):
_name = "hr.evaluation.reminder"
_description = "Sends Reminders to employess to fill the evaluations"
_columns = {
'evaluation_id': fields.many2one('hr_evaluation.evaluation', 'Evaluations', required=True)
'evaluation_id': fields.many2one('hr.evaluation.interview', 'Interview', required=True)
}
def send_mail(self, cr, uid, ids, context=None):

View File

@ -51,6 +51,7 @@
'process/hr_expense_process.xml',
'report/hr_expense_report_view.xml',
'board_hr_expense_view.xml',
'board_hr_expense_manager_view.xml'
],
'demo_xml': [
'hr_expense_demo.xml',

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="action_employee_expense" model="ir.actions.act_window">
<field name="name">All Employee Expenses</field>
<field name="res_model">hr.expense.expense</field>
<field name="view_type">form</field>
<field name="domain">[('state','in',('confirm', 'accepted'))]</field>
<field name="view_id" ref="hr_expense.view_editable_expenses_tree"/>
</record>
<record id="board_hr_manager_expense_form" model="ir.ui.view">
<field name="name">board.hr.manager.expense.form</field>
<field name="model">board.board</field>
<field name="inherit_id" ref="hr.board_hr_manager_form"/>
<field name="type">form</field>
<field name="arch" type="xml">
<xpath expr="/form/hpaned/child1" position="inside">
<action colspan="4" height="220" name="%(action_employee_expense)d" string="All Employee Expenses" />
</xpath>
</field>
</record>
<menuitem
action="hr.open_board_hr_manager"
icon="terp-graph"
id="base.menu_hr_manager"
parent="base.menu_hr_dasboard"
groups = "base.group_hr_manager"
sequence="5"/>
</data>
</openerp>

View File

@ -13,7 +13,7 @@
<field name="name">My Expenses</field>
<field name="res_model">hr.expense.expense</field>
<field name="view_type">form</field>
<field name="domain">[('state','in',('draft', 'confirm')),('user_id','=',uid)]</field>
<field name="domain">[('state','in',('confirm', 'accepted')),('user_id','=',uid)]</field>
<field name="view_id" ref="hr_expense.view_editable_expenses_tree"/>
</record>

View File

@ -61,12 +61,12 @@ class hr_expense_expense(osv.osv):
_name = "hr.expense.expense"
_description = "Expense"
_columns = {
'name': fields.char('Expense Sheet', size=128, required=True),
'name': fields.char('Description', size=128, required=True),
'id': fields.integer('Sheet ID', readonly=True),
'ref': fields.char('Reference', size=32),
'date': fields.date('Date'),
'journal_id': fields.many2one('account.journal', 'Force Journal', help = "The journal used when the expense is invoiced"),
'employee_id': fields.many2one('hr.employee', "Employee's Name", required=True),
'employee_id': fields.many2one('hr.employee', "Employee", required=True),
'user_id': fields.many2one('res.users', 'User', required=True),
'date_confirm': fields.date('Confirmation Date', help = "Date of the confirmation of the sheet expense. It's filled when the button Confirm is pressed."),
'date_valid': fields.date('Validation Date', help = "Date of the acceptation of the sheet expense. It's filled when the button Accept is pressed."),
@ -81,11 +81,11 @@ class hr_expense_expense(osv.osv):
'company_id': fields.many2one('res.company', 'Company', required=True),
'state': fields.selection([
('draft', 'Draft'),
('confirm', 'Waiting confirmation'),
('accepted', 'Accepted'),
('confirm', 'Waiting Approval'),
('accepted', 'Approved'),
('invoiced', 'Invoiced'),
('paid', 'Reimbursed'),
('cancelled', 'Cancelled')],
('cancelled', 'Refused')],
'State', readonly=True, help='When the expense request is created the state is \'Draft\'.\n It is confirmed by the user and request is sent to admin, the state is \'Waiting Confirmation\'.\
\nIf the admin accepts it, the state is \'Accepted\'.\n If an invoice is made for the expense request, the state is \'Invoiced\'.\n If the expense is paid to user, the state is \'Reimbursed\'.'),
}

View File

@ -104,6 +104,17 @@
<field name="uom_id" ref="product.product_uom_km"/>
<field eval="622.0" name="unit_quantity"/>
</record>
<record id="property_rule_expense" model="ir.rule">
<field name="name">Employee Expense</field>
<field model="ir.model" name="model_id" ref="model_hr_expense_expense"/>
<field name="domain_force">[('employee_id.user_id','=',user.id)]</field>
<field name="groups" eval="[(6,0,[ref('base.group_user')])]"/>
</record>
<record id="property_rule_expense_manager" model="ir.rule">
<field name="name">Manager Expense</field>
<field model="ir.model" name="model_id" ref="model_hr_expense_expense"/>
<field name="domain_force">['|',('employee_id.user_id','=',user.id),('employee_id.parent_id.user_id','=',user.id )]</field>
<field name="groups" eval="[(6,0,[ref('base.group_hr_user'),ref('base.group_hr_manager')])]"/>
</record>
</data>
</openerp>

View File

@ -27,12 +27,12 @@
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Expenses" colors="blue:state=='draft'">
<field name="date"/>
<field name="employee_id"/>
<field name="user_id" invisible="1"/>
<field name="department_id" groups="base.group_extended"/>
<field name="name"/>
<field name="date"/>
<field name="ref"/>
<field name="name"/>
<field name="amount"/>
<field name="state"/>
<button name="confirm" states="draft" string="Confirm" type="workflow" icon="gtk-apply"/>
@ -77,7 +77,7 @@
<field name="company_id" groups="base.group_multi_company"/>
</group>
<notebook colspan="4">
<page string="Expense Sheet">
<page string="Description">
<newline/>
<field colspan="4" name="line_ids" nolabel="1">
<form string="Expense Lines">
@ -98,10 +98,10 @@
<group col="6" colspan="2">
<button name="confirm" states="draft" string="Confirm" type="workflow" icon="gtk-apply"/>
<button name="cancel" states="cancel" string="Cancel" type="workflow" icon="gtk-cancel"/>
<button name="validate" states="confirm" string="Accept" type="workflow" icon="gtk-ok"/>
<button name="draft" states="confirm,cancelled" string="Set to Draft" type="workflow" icon="gtk-convert"/>
<button name="validate" states="confirm" string="Approve" type="workflow" icon="terp-camera_test"/>
<button name="invoice" states="accepted" string="Invoice" type="workflow" icon="gtk-execute"/>
<button name="draft" states="confirm,cancelled" string="Set to Draft" type="workflow" icon="gtk-convert"/>
<button name="refuse" states="confirm,draft,accepted" string="Refuse" type="workflow" icon="gtk-no"/>
<button name="refuse" states="confirm,draft,accepted" string="Refuse" type="workflow" icon="gtk-no" groups="base.group_hr_manager" />
</group>
</page>
<page string="Other Info" groups="base.group_extended">
@ -134,14 +134,16 @@
<group>
<filter icon="terp-document-new" domain="[('state','=','draft')]" string="Draft" help="Draft Expense"/>
<separator orientation="vertical"/>
<filter icon="terp-gtk-go-back-rtl" domain="[('state','=','confirm')]" string="To Approve"
<filter icon="terp-camera_test" domain="[('state','=','confirm')]" string="To Approve"
help="Confirmed Expense"/>
<filter icon="terp-gtk-go-back-rtl" domain="[('state','=','accepted')]" string="To Pay"
<filter icon="terp-check" domain="[('state','=','accepted')]" string="To Pay"
help="Expenses to Invoice"/>
<filter icon="terp-go-month" string="This Month" name="this"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"/>
<separator orientation="vertical"/>
<field name="name" select='1'/>
<field name="date" select='1'/>
<field name="user_id" string="User">
<field name="user_id" string="User" invisible="True">
<filter icon="terp-personal+" domain="[('department_id','=',context.get('department_id',False))]"
string="Expenses of My Department"/>
</field>
@ -149,8 +151,9 @@
</group>
<newline />
<group expand="0" string="Group By...">
<filter string="Employee" icon="terp-personal" domain="[]" context="{'group_by':'employee_id'}"/>
<separator orientation="vertical"/>
<filter string="Department" icon="terp-personal+" domain="[]" context="{'group_by':'department_id'}"/>
<filter string="User" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<separator orientation="vertical"/>
<filter string="Month" icon="terp-go-month" domain="[]" context="{'group_by':'date'}"/>
</group>
@ -162,7 +165,7 @@
<field name="name">Expenses</field>
<field name="res_model">hr.expense.expense</field>
<field name="view_type">form</field>
<field name="context">{"search_default_user_id":uid}</field>
<field name="context">{"search_default_user_id":uid,'search_default_this':1}</field>
<field name="search_view_id" ref="view_hr_expense_filter"/>
<field name="help">The OpenERP expenses management module allows you to track the full flow. Every month, the employees record their expenses. At the end of the month, their managers validates the expenses sheets which creates costs on projects/analytic accounts. The accountant validates the proposed entries and the employee can be reimbursed. You can also reinvoice the customer at the end of the flow.</field>
</record>

View File

@ -181,7 +181,7 @@
<blockTable colWidths="49.0,204.0,46.0,79.0,53.0,92.0" style="Table_expense_line">
<tr>
<td>
<para style="terp_default_9">[[ formatLang(line.date_value,date=True) ]]</para>
<para style="terp_default_9">[[ formatLang(line.date_value,date = True) ]]</para>
</td>
<td>
<para style="terp_default_9">[[ line.name or '' ]] [[ line.description or '' ]]</para>
@ -273,4 +273,4 @@
</para>
<para style="terp_default_9">This document must be dated and signed for reimbursement</para>
</story>
</document>
</document>

View File

@ -48,8 +48,8 @@ class hr_expense_report(osv.osv):
'user_id':fields.many2one('res.users', 'Validation User', readonly=True),
'currency_id': fields.many2one('res.currency', 'Currency', readonly=True),
'price_total':fields.float('Total Price', readonly=True),
'delay_valid':fields.float('Delay Valid', readonly=True),
'delay_confirm':fields.float('Delay Confirm', readonly=True),
'delay_valid':fields.float('Delay to Valid', readonly=True),
'delay_confirm':fields.float('Delay to Confirm', readonly=True),
'analytic_account': fields.many2one('account.analytic.account','Analytic account',readonly=True),
'price_average':fields.float('Average Price', readonly=True),
'nbr':fields.integer('# of Lines', readonly=True),
@ -71,7 +71,7 @@ class hr_expense_report(osv.osv):
create or replace view hr_expense_report as (
select
min(l.id) as id,
date_trunc('day',s.create_date) as date,
date_trunc('day',s.date) as date,
s.employee_id,
s.journal_id,
s.currency_id,
@ -100,7 +100,7 @@ class hr_expense_report(osv.osv):
left join hr_expense_expense s on (s.id=l.expense_id)
left join product_uom u on (u.id=l.uom_id)
group by
date_trunc('day',s.create_date),
date_trunc('day',s.date),
to_char(date_trunc('day',s.create_date), 'YYYY'),
to_char(date_trunc('day',s.create_date), 'MM'),
to_char(date_trunc('day',s.create_date), 'YYYY-MM-DD'),

View File

@ -22,9 +22,9 @@
<field name="product_id" invisible="1"/>
<field name="product_qty" invisible="1"/>
<field name="state" invisible="1"/>
<field name="invoiced" sum="Total Invoiced Lines"/>
<field name="nbr" sum="# of Lines"/>
<field name="no_of_products" sum="# of Products"/>
<field name="invoiced" sum="Total Invoiced Lines"/>
<field name="price_average" avg="Average Price"/>
<field name="price_total" sum="Total Price"/>
<field name="delay_confirm"/>
@ -53,46 +53,29 @@
<field name="arch" type="xml">
<search string="Expenses Analysis">
<group>
<filter icon="terp-go-year" string=" 365 Days "
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
help="Expenses during last 7 year"/>
<filter icon="terp-go-month" string=" 30 Days "
<filter icon="terp-go-year" string=" Year "
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;=',time.strftime('%%Y-01-01'))]"
help="Expenses during current year"/>
<filter icon="terp-go-month" string=" Month "
name="month"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
help="Expenses during last month"/>
<filter icon="terp-go-week" string=" 7 Days " separator="1"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]" help="Expenses during last 7 days"/>
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;=',time.strftime('%%Y-%%m-01'))]"
help="Expenses during current month"/>
<filter icon="terp-go-month" string=" Month-1 " separator="1"
domain="[('date','&lt;=', (datetime.date (int(time.strftime('%%Y')), datetime.date.today().month, 1) - datetime.timedelta (days = 1)).strftime('%%Y-%%m-%%d')),('date','&gt;',(datetime.date (int(time.strftime('%%Y')), datetime.date.today().month-1, 1)).strftime('%%Y-%%m-%%d'))]" help="Expenses during last month"/>
<separator orientation="vertical"/>
<filter string="Draft" icon="terp-document-new" domain="[('state','=','draft')]" help = "Draft Expenses"/>
<filter string="Waiting" icon="terp-gtk-media-pause" domain="[('state', '=' ,'confirm')]"
help = "Confirm Expenses"/>
<filter string="Accepted" icon="terp-camera_test" domain="[('state','=','accepted')]"
help = "Accepted Expenses"/>
<separator orientation="vertical"/>
<filter string="Invoiced" icon="terp-dolar" domain="[('state','=','invoiced')]"
help = "Invoiced Expenses"/>
<separator orientation="vertical"/>
<field name="employee_id"/>
<field name="department_id"/>
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="Employee" name="employee" icon="terp-personal" context="{'group_by':'employee_id'}"/>
<filter string="Department" icon="terp-personal+" context="{'group_by':'department_id'}"/>
<separator orientation="vertical"/>
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
<separator orientation="vertical"/>
<filter string="Analytic account" icon="terp-folder-green" context="{'group_by':'analytic_account'}"/>
<separator orientation="vertical"/>
<filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
<separator orientation="vertical"/>
<filter string="Validation User" name="User" icon="terp-personal" context="{'group_by':'user_id'}"/>
<separator orientation="vertical"/>
<filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<separator orientation="vertical"/>
<filter string="Day" icon="terp-go-today" context="{'group_by':'day'}"/>
<filter string="Month" icon="terp-go-month" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
</group>
<newline/>
<group expand="0" string="Extended filters..." groups="base.group_extended">
</group>
<newline/>
<group expand="0" string="Extended filters..." groups="base.group_extended">
<field name="product_id"/>
<separator orientation="vertical"/>
<field name="user_id"/>
@ -102,7 +85,24 @@
<field name="date"/>
<field name="date_confirm"/>
<field name="date_valid"/>
</group>
</group>
<newline/>
<group expand="1" string="Group By...">
<filter string="Employee" name="employee" icon="terp-personal" context="{'group_by':'employee_id'}"/>
<filter string="Validation User" name="User" icon="terp-personal" context="{'group_by':'user_id'}"/>
<filter string="Department" icon="terp-personal+" context="{'group_by':'department_id'}"/>
<separator orientation="vertical"/>
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
<separator orientation="vertical"/>
<filter string="Analytic account" icon="terp-folder-green" context="{'group_by':'analytic_account'}"/>
<separator orientation="vertical"/>
<filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
<filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<separator orientation="vertical"/>
<filter string="Day" icon="terp-go-today" context="{'group_by':'day'}" help="Group by Create Date"/>
<filter string="Month" icon="terp-go-month" context="{'group_by':'month'}" help="Group by month of Create Date"/>
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}" help="Group by year of Create Date"/>
</group>
</search>
</field>
</record>

View File

@ -1,10 +1,18 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_hr_expense_expense_user","hr.expense.expense.user","model_hr_expense_expense","base.group_hr_user",1,1,1,1
"access_hr_expense_line","hr.expense.line","model_hr_expense_line","base.group_hr_user",1,1,1,1
"access_hr_expense_report","hr.expense.report","model_hr_expense_report","base.group_hr_manager",1,0,0,0
"access_hr_expense_report","hr.expense.report","model_hr_expense_report","base.group_hr_manager",1,1,1,1
"access_product_product_hr_expense","product.product.hr.expense","product.model_product_product","base.group_hr_user",1,0,0,0
"access_product_template_hr_expense","product.template.hr.expense","product.model_product_template","base.group_hr_user",1,0,0,0
"access_product_uom_hr_expense","product.uom.hr.expense","product.model_product_uom","base.group_hr_user",1,0,0,0
"access_product_price_type","product.price.type","product.model_product_price_type","base.group_hr_user",1,1,1,1
"access_hr_expense_expense_manager","hr.expense.expense.manager","model_hr_expense_expense","base.group_hr_manager",1,0,0,0
"access_hr_expense_expense_manager","hr.expense.expense.manager","model_hr_expense_expense","base.group_hr_manager",1,1,1,1
"access_hr_expense_expense_system","hr.expense.expense.system","model_hr_expense_expense","base.group_system",1,0,0,0
"access_hr_expense_line_manager","hr.expense.line.manager","model_hr_expense_line","base.group_hr_manager",1,1,1,1
"access_product_product_hr_expense_manager","product.product.hr.expense.manager","product.model_product_product","base.group_hr_manager",1,1,1,1
"access_product_template_hr_expense_manager","product.template.hr.expense.manager","product.model_product_template","base.group_hr_manager",1,1,1,1
"access_product_uom_hr_expense_manager","product.uom.hr.expense.manager","product.model_product_uom","base.group_hr_manager",1,1,1,1
"access_product_price_type_manager","product.price.type.manager","product.model_product_price_type","base.group_hr_manager",1,1,1,1
"access_hr_expense_expense_employee","hr.expense.expense.employee","model_hr_expense_expense","base.group_user",1,0,0,0
"access_hr_employee_employee","hr.employee.employee","hr.model_hr_employee","base.group_user",1,0,0,0
"access_hr_expense_line_employee","hr.expense.line.employee","model_hr_expense_line","base.group_user",1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_hr_expense_expense_user hr.expense.expense.user model_hr_expense_expense base.group_hr_user 1 1 1 1
3 access_hr_expense_line hr.expense.line model_hr_expense_line base.group_hr_user 1 1 1 1
4 access_hr_expense_report hr.expense.report model_hr_expense_report base.group_hr_manager 1 0 1 0 1 0 1
5 access_product_product_hr_expense product.product.hr.expense product.model_product_product base.group_hr_user 1 0 0 0
6 access_product_template_hr_expense product.template.hr.expense product.model_product_template base.group_hr_user 1 0 0 0
7 access_product_uom_hr_expense product.uom.hr.expense product.model_product_uom base.group_hr_user 1 0 0 0
8 access_product_price_type product.price.type product.model_product_price_type base.group_hr_user 1 1 1 1
9 access_hr_expense_expense_manager hr.expense.expense.manager model_hr_expense_expense base.group_hr_manager 1 0 1 0 1 0 1
10 access_hr_expense_expense_system hr.expense.expense.system model_hr_expense_expense base.group_system 1 0 0 0
11 access_hr_expense_line_manager hr.expense.line.manager model_hr_expense_line base.group_hr_manager 1 1 1 1
12 access_product_product_hr_expense_manager product.product.hr.expense.manager product.model_product_product base.group_hr_manager 1 1 1 1
13 access_product_template_hr_expense_manager product.template.hr.expense.manager product.model_product_template base.group_hr_manager 1 1 1 1
14 access_product_uom_hr_expense_manager product.uom.hr.expense.manager product.model_product_uom base.group_hr_manager 1 1 1 1
15 access_product_price_type_manager product.price.type.manager product.model_product_price_type base.group_hr_manager 1 1 1 1
16 access_hr_expense_expense_employee hr.expense.expense.employee model_hr_expense_expense base.group_user 1 0 0 0
17 access_hr_employee_employee hr.employee.employee hr.model_hr_employee base.group_user 1 0 0 0
18 access_hr_expense_line_employee hr.expense.line.employee model_hr_expense_line base.group_user 1 0 0 0

View File

@ -63,6 +63,7 @@
'wizard/hr_holidays_summary_department_view.xml',
'wizard/hr_holidays_summary_employees_view.xml',
'board_hr_holidays_view.xml',
'board_hr_manager_holidays_view.xml',
],
'demo_xml': ['hr_holidays_demo.xml',],
'test': ['test/test_hr_holiday.yml',

View File

@ -15,20 +15,10 @@
<field name="res_model">hr.holidays</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('user_id','=',uid)]</field>
<field name="domain">[('state','in',('confirm', 'validate')),('user_id','=',uid)]</field>
<field name="view_id" ref="hr_holidays.open_allocation_holidays"/>
</record>
<record id="action_hr_holidays_remaining_leaves_user_all" model="ir.actions.act_window">
<field name="name">Remaining Leaves by User</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">hr.holidays.remaining.leaves.user</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
<field name="domain">[('user_id','=',uid)]</field>
<field name="view_id" ref="hr_holidays.view_hr_holidays_remaining_leaves_user_graph"/>
</record>
<record id="board_hr_holidays_form" model="ir.ui.view">
<field name="name">board.hr.holidays.form</field>
<field name="model">board.board</field>
@ -42,17 +32,27 @@
</record>
<!-- Need to merge in above view -->
<record id="board_hr_holidays_remaining_form" model="ir.ui.view">
<field name="name">board.hr.holidays.remaining.form</field>
<record id="action_hr_holidays_leaves_by_month" model="ir.actions.act_window">
<field name="name">Leaves by Month</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">available.holidays.report</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
<field name="domain">[('user_id','=',uid)]</field>
<field name="context">{'group_by_no_leaf':1,'group_by':['month']}</field>
<field name="view_id" ref="hr_holidays.view_hr_available_holidays_report_graph"/>
</record>
<record id="board_hr_holidays_leave_by_month_form" model="ir.ui.view">
<field name="name">board.hr.holidays.leave.month.form</field>
<field name="model">board.board</field>
<field name="type">form</field>
<field name="inherit_id" ref="hr.board_hr_form"/>
<field name="arch" type="xml">
<xpath expr="/form/hpaned/child2" position="inside">
<action colspan="4" height="220" name="%(action_hr_holidays_remaining_leaves_user_all)d" string="Reamining Leaves by Type and User" />
<action colspan="4" height="220" name="%(action_hr_holidays_leaves_by_month)d" string="Leaves by Month" />
</xpath>
</field>
</record>
</data>
</openerp>

View File

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="action_view_holiday_status_manager_board" model="ir.actions.act_window">
<field name="name">All Employee Leaves</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">hr.holidays</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state','in',('confirm', 'validate'))]</field>
<field name="view_id" ref="hr_holidays.view_holiday_allocation_tree"/>
</record>
<record id="action_hr_holidays_remaining_leaves_empoloyee_all" model="ir.actions.act_window">
<field name="name">Remaining Leaves by User</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">hr.holidays.remaining.leaves.user</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
<field name="view_id" ref="hr_holidays.view_hr_holidays_remaining_leaves_user_graph"/>
</record>
<record id="board_hr_holidays_manager_form" model="ir.ui.view">
<field name="name">board.hr.holidays.manager.form</field>
<field name="model">board.board</field>
<field name="inherit_id" ref="hr.board_hr_manager_form"/>
<field name="type">form</field>
<field name="arch" type="xml">
<xpath expr="/form/hpaned/child1" position="inside">
<action colspan="4" height="220" name="%(action_view_holiday_status_manager_board)d" string="All Employee Leaves"/>
</xpath>
</field>
</record>
<record id="board_hr_holidays_manager_remaining_form" model="ir.ui.view">
<field name="name">board.hr.holidays.manager.remaining.form</field>
<field name="model">board.board</field>
<field name="type">form</field>
<field name="inherit_id" ref="hr.board_hr_manager_form"/>
<field name="arch" type="xml">
<xpath expr="/form/hpaned/child2" position="inside">
<action colspan="4" height="220" name="%(action_hr_holidays_remaining_leaves_empoloyee_all)d" string="Remaining Leave by Type and User" />
</xpath>
</field>
</record>
<menuitem
action="hr.open_board_hr_manager"
icon="terp-graph"
id="base.menu_hr_manager"
parent="base.menu_hr_dasboard"
groups = "base.group_hr_manager"
sequence="5"/>
</data>
</openerp>

View File

@ -142,15 +142,17 @@ class hr_holidays(osv.osv):
_columns = {
'name': fields.char('Description', required=True, readonly=True, size=64, states={'draft':[('readonly',False)]}),
'state': fields.selection([('draft', 'Draft'), ('confirm', 'Waiting Validation'), ('refuse', 'Refused'), ('validate1', 'Waiting Second Validation'), ('validate', 'Validated'), ('cancel', 'Cancelled')], 'State', readonly=True, help='When the holiday request is created the state is \'Draft\'.\n It is confirmed by the user and request is sent to admin, the state is \'Waiting Validation\'.\
If the admin accepts it, the state is \'Validated\'. If it is refused, the state is \'Refused\'.'),
'state': fields.selection([('draft', 'Draft'), ('confirm', 'Waiting Approval'), ('refuse', 'Refused'), ('validate1', 'Waiting Second Approval'), ('validate', 'Approved'), ('cancel', 'Cancelled')], 'State', readonly=True, help='When the holiday request is created the state is \'Draft\'.\n It is confirmed by the user and request is sent to admin, the state is \'Waiting Approval\'.\
If the admin accepts it, the state is \'Approved\'. If it is refused, the state is \'Refused\'.'),
'date_from': fields.datetime('Start Date', readonly=True, states={'draft':[('readonly',False)]}),
'user_id':fields.many2one('res.users', 'User', states={'draft':[('readonly',False)]}, select=True, readonly=True),
'date_to': fields.datetime('End Date', readonly=True, states={'draft':[('readonly',False)]}),
'holiday_status_id' : fields.many2one("hr.holidays.status", " Leave Type", required=True,readonly=True, states={'draft':[('readonly',False)]}),
'holiday_status_id' : fields.many2one("hr.holidays.status", " Leave Type", required=True,readonly=True, states={'draft':[('readonly',False)]}),
'employee_id' : fields.many2one('hr.employee', "Employee", select=True, invisible=False, readonly=True, states={'draft':[('readonly',False)]}, help='Leave Manager can let this field empty if this leave request/allocation is for every employee'),
'manager_id': fields.many2one('hr.employee', 'Leave Manager', invisible=False, readonly=True, help='This area is automaticly filled by the user who validate the leave'),
'notes': fields.text('Notes',readonly=True, states={'draft':[('readonly',False)]}),
#'manager_id': fields.many2one('hr.employee', 'Leave Manager', invisible=False, readonly=True, help='This area is automaticly filled by the user who validate the leave'),
#'notes': fields.text('Notes',readonly=True, states={'draft':[('readonly',False)]}),
'manager_id': fields.many2one('hr.employee', 'First Approval', invisible=False, readonly=True, help='This area is automaticly filled by the user who validate the leave'),
'notes': fields.text('Reasons',readonly=True, states={'draft':[('readonly',False)]}),
'number_of_days': fields.float('Number of Days', readonly=True, states={'draft':[('readonly',False)]}),
'number_of_days_temp': fields.float('Number of Days', readonly=True, states={'draft':[('readonly',False)]}),
'case_id': fields.many2one('crm.meeting', 'Case'),
@ -160,8 +162,8 @@ class hr_holidays(osv.osv):
'linked_request_ids': fields.one2many('hr.holidays', 'parent_id', 'Linked Requests',),
'department_id':fields.related('employee_id', 'department_id', string='Department', type='many2one', relation='hr.department', readonly=True, store=True),
'category_id': fields.many2one('hr.employee.category', "Category", help='Category Of employee'),
'holiday_type': fields.selection([('employee','By Employee'),('category','By Employee Category')], 'Holiday Type', help='By Employee: Allocation/Request for individual Employee, By Employee Category: Allocation/Request for group of employees in category'),
'manager_id2': fields.many2one('hr.employee', 'Second Validator', readonly=True, help='This area is automaticly filled by the user who validate the leave with second level (If Leave type need second validation)')
'holiday_type': fields.selection([('employee','By Employee'),('category','By Employee Category')], 'Allocation Type', help='By Employee: Allocation/Request for individual Employee, By Employee Category: Allocation/Request for group of employees in category'),
'manager_id2': fields.many2one('hr.employee', 'Second Approval', readonly=True, help='This area is automaticly filled by the user who validate the leave with second level (If Leave type need second validation)')
}
_defaults = {

View File

@ -48,5 +48,18 @@
<workflow action="confirm" model="hr.holidays" ref="hr_holidays_employee1_sl"/>
<workflow action="validate" model="hr.holidays" ref="hr_holidays_employee1_sl"/>
<record id="property_rule_holidays" model="ir.rule">
<field name="name">Employee Holidays</field>
<field model="ir.model" name="model_id" ref="model_hr_holidays"/>
<field name="domain_force">[('employee_id.user_id','=',user.id)]</field>
<field name="groups" eval="[(6,0,[ref('base.group_user')])]"/>
</record>
<record id="property_rule_holidays_manager" model="ir.rule">
<field name="name">Manager Holidays</field>
<field model="ir.model" name="model_id" ref="model_hr_holidays"/>
<field name="domain_force">['|',('employee_id.user_id','=',user.id),('employee_id.parent_id.user_id','=',user.id )]</field>
<field name="groups" eval="[(6,0,[ref('base.group_hr_user'),ref('base.group_hr_manager')])]"/>
</record>
</data>
</openerp>

View File

@ -9,27 +9,37 @@
<field name="arch" type="xml">
<search string="Search Leave">
<group col='8' colspan='4'>
<filter icon="terp-gtk-go-back-rtl" domain="[('state','=','draft')]" string="To Confirm"/>
<filter icon="terp-gtk-go-back-rtl" domain="[('state','=','confirm')]" string="To Approve"/>
<filter icon="terp-camera_test" domain="[('state','=','validate')]" string="Validated"
default="context.get('report', False)"/>
default="context.get('report', False)"/>
<separator orientation="vertical"/>
<filter icon="terp-check" domain="[('state','=','draft')]" string="To Confirm"/>
<filter icon="terp-camera_test" domain="[('state','=','confirm')]" string="To Approve"/>
<separator orientation="vertical"/>
<field name="user_id"/>
<filter string="This Month" icon="terp-go-month" name="This Month"
domain="[('date_from','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date_from','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"/>
<separator orientation="vertical"/>
<field name="employee_id"/>
<field name="department_id" widget="selection">
<filter icon="terp-personal+" help="My Department Holidays"
domain="[('department_id.manager_id','=',uid)]" />
</field>
<field name="holiday_status_id" widget="selection"/>
</group>
<newline/>
<group expand="0" string="Extended options...">
<field name="date_from"/>
<field name="date_to"/>
</group>
<newline />
<group expand="0" string="Group By...">
<filter string="Department" icon="terp-personal+" domain="[]" context="{'group_by':'department_id'}"/>
<filter string="Manager" icon="terp-personal" domain="[]" context="{'group_by':'manager_id'}"/>
<filter string="User" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<separator orientation="vertical"/>
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
<filter string="Employee" icon="terp-personal" domain="[]" context="{'group_by':'employee_id'}"/>
<filter string="Manager" icon="terp-personal" domain="[]" context="{'group_by':'manager_id'}"/>
<filter string="Department" icon="terp-personal+" domain="[]" context="{'group_by':'department_id','set_visible':True}"/>
<separator orientation="vertical"/>
<filter string="Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'holiday_status_id'}"
default="context.get('report', False)"/>
<separator orientation="vertical"/>
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
</group>
</search>
</field>
@ -57,7 +67,7 @@
<form string="Leave Request">
<group col="8" colspan="4">
<field name="name" />
<field name="holiday_type" on_change="onchange_type(holiday_type)" attrs="{'readonly':[('state','!=','draft')]}" width="130"/>
<field name="holiday_type" on_change="onchange_type(holiday_type)" attrs="{'readonly':[('state','!=','draft')]}" width="130" groups="base.group_hr_manager"/>
<group attrs="{'invisible':[('holiday_type','=','employee')]}">
<field name="category_id" attrs="{'required':[('holiday_type','=','category')], 'readonly':[('state','!=','draft')]}"/>
</group>
@ -75,17 +85,17 @@
<newline/>
<field name="manager_id"/>
<field name="manager_id2"/>
<separator string="Notes" colspan="4"/>
<separator string="Reasons" colspan="4"/>
<field name="notes" nolabel="1" colspan="4"/>
<newline/>
<field name="state" colspan="2"/>
<group colspan="2">
<button string="Confirm" name="confirm" states="draft" type="workflow" icon="gtk-yes"/>
<button string="Approve" name="validate" states="confirm" type="workflow" icon="gtk-apply"/>
<button string="Approved" name="second_validate" states="validate1" type="workflow" icon="gtk-apply"/>
<button string="Refuse" name="refuse" states="confirm,validate1" type="workflow" icon="gtk-no"/>
<button string="Cancel" name="cancel" states="validate,refuse" type="workflow" icon="gtk-cancel"/>
<button string="Set to Draft" name="set_to_draft" states="cancel" type="object" icon="gtk-convert"/>
<button string="Confirm" name="confirm" states="draft" type="workflow" icon="gtk-yes" groups="base.group_hr_user,base.group_hr_manager"/>
<button string="Approve" name="validate" states="confirm" type="workflow" icon="gtk-apply" groups="base.group_hr_manager"/>
<button string="Approved" name="second_validate" states="validate1" type="workflow" icon="gtk-apply" groups="base.group_hr_manager"/>
<button string="Refuse" name="refuse" states="confirm,validate1" type="workflow" icon="gtk-no" groups="base.group_hr_manager"/>
<button string="Cancel" name="cancel" states="validate,refuse" type="workflow" icon="gtk-cancel" groups="base.group_hr_manager"/>
<button string="Set to Draft" name="set_to_draft" states="cancel" type="object" icon="gtk-convert" groups="base.group_hr_manager"/>
</group>
</page>
</notebook>
@ -100,36 +110,35 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Allocation Request">
<group col="4" colspan="4">
<group col="8" colspan="4">
<field name="name" />
<field name="holiday_status_id" />
<field name="holiday_type" on_change="onchange_type(holiday_type)" attrs="{'readonly':[('state','!=','draft')]}" string="Allocation Type"/>
<group col="2" colspan="2">
<group attrs="{'invisible':[('holiday_type','=','category')]}">
<field name="employee_id" attrs="{'required':[('holiday_type','=','employee')]}"/>
</group>
<group attrs="{'invisible':[('holiday_type','=','employee')]}">
<field name="category_id" attrs="{'required':[('holiday_type','=','category')], 'readonly':[('state','!=','draft')]}"/>
</group>
</group>
</group>
<notebook colspan="4">
<page string="General">
<field name="holiday_status_id" on_change="onchange_sec_id(holiday_status_id)" context="{'employee_id':employee_id}" />
<field name="department_id"/>
<field name="number_of_days_temp"/>
<field name="department_id"/>
<newline/>
<field name="manager_id"/>
<field name="manager_id2"/>
<separator string="Notes" colspan="4"/>
<separator string="Reasons" colspan="4"/>
<field name="notes" nolabel="1" colspan="4" />
<newline/>
<field name="state" colspan="2"/>
<group colspan="2">
<button string="Confirm" name="confirm" states="draft" type="workflow" icon="gtk-yes"/>
<button string="To Approve" name="validate" states="confirm" type="workflow" icon="gtk-apply"/>
<button string="Approved" name="second_validate" states="validate1" type="workflow" icon="gtk-apply"/>
<button string="Refuse" name="refuse" states="confirm,validate1" type="workflow" icon="gtk-no"/>
<button string="Cancel" name="cancel" states="validate,refuse" type="workflow" icon="gtk-cancel"/>
<button string="Set to Draft" name="set_to_draft" states="cancel" type="object" icon="gtk-convert"/>
<button string="Confirm" name="confirm" states="draft" type="workflow" icon="gtk-yes" groups="base.group_hr_user,base.group_hr_manager"/>
<button string="Approve" name="validate" states="confirm" type="workflow" icon="gtk-apply" groups="base.group_hr_manager"/>
<button string="Approved" name="second_validate" states="validate1" type="workflow" icon="gtk-apply" groups="base.group_hr_manager"/>
<button string="Refuse" name="refuse" states="confirm,validate1" type="workflow" icon="gtk-no" groups="base.group_hr_manager"/>
<button string="Cancel" name="cancel" states="validate,refuse" type="workflow" icon="gtk-cancel" groups="base.group_hr_manager"/>
<button string="Set to Draft" name="set_to_draft" states="cancel" type="object" icon="gtk-convert" groups="base.group_hr_manager"/>
</group>
</page>
</notebook>
@ -144,14 +153,20 @@
<field name="arch" type="xml">
<tree colors="red:state in ('refuse');blue:state in (' draft');black:state in ('confirm','validate','validate1');gray:state in ('cancel') " string="Leaves" >
<field name="employee_id"/>
<field name="department_id"/>
<field name="number_of_days" string="Number of Days" sum='Remaining Days'/>
<field name="name"/>
<field name="department_id" invisible="1"/>
<field name="holiday_status_id"/>
<field name="name"/>
<field name="number_of_days" string="Number of Days" sum='Remaining Days'/>
<field name="manager_id" invisible="1"/>
<field name="user_id" invisible="1"/>
<field name="type"/>
<!--field name="type"/-->
<field name="state"/>
<button string="Confirm" name="confirm" states="draft" type="workflow" icon="gtk-yes" groups="base.group_hr_user,base.group_hr_manager"/>
<button string="Approve" name="validate" states="confirm" type="workflow" icon="gtk-apply" groups="base.group_hr_manager"/>
<button string="Approved" name="second_validate" states="validate1" type="workflow" icon="gtk-apply" groups="base.group_hr_manager"/>
<button string="Refuse" name="refuse" states="confirm,validate1" type="workflow" icon="gtk-no" groups="base.group_hr_manager"/>
<button string="Cancel" name="cancel" states="validate,refuse" type="workflow" icon="gtk-cancel" groups="base.group_hr_manager"/>
<button string="Set to Draft" name="set_to_draft" states="cancel" type="object" icon="gtk-convert" groups="base.group_hr_manager"/>
</tree>
</field>
</record>
@ -197,15 +212,20 @@
<tree colors="red:state in ('refuse');blue:state in (' draft');black:state in ('confirm','validate','validate1');gray:state in ('cancel')" string="Leaves Summary">
<field name="employee_id"/>
<field name="department_id" invisible="1"/>
<field name="type"/>
<field name="name"/>
<field name="number_of_days" string="Number of Days" sum='Remaining Days'/>
<field name="date_from" invisible="1"/>
<field name="date_to" invisible="1"/>
<field name="name" invisible="1"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="holiday_status_id"/>
<field name="manager_id" invisible="1"/>
<field name="user_id" invisible="1"/>
<field name="type" invisible="1"/>
<field name="state" invisible="1"/>
<field name="state"/>
<button string="Confirm" name="confirm" states="draft" type="workflow" icon="gtk-yes" groups="base.group_hr_user,base.group_hr_manager"/>
<button string="Approve" name="validate" states="confirm" type="workflow" icon="gtk-apply" groups="base.group_hr_manager"/>
<button string="Refuse" name="refuse" states="confirm" type="workflow" icon="gtk-no" groups="base.group_hr_manager"/>
<button string="Cancel" name="cancel" states="validate,refuse,validate1" type="workflow" icon="gtk-cancel" groups="base.group_hr_manager"/>
<button string="Set to Draft" name="set_to_draft" states="cancel" type="object" icon="gtk-convert" groups="base.group_hr_manager"/>
</tree>
</field>
</record>
@ -218,16 +238,21 @@
<field name="arch" type="xml">
<tree colors="red:state in ('refuse');blue:state in (' draft');black:state in ('confirm','validate','validate1');gray:state in ('cancel')">
<field name="employee_id"/>
<field name="department_id"/>
<field name="department_id" invisible="not context.get('set_visible',False)"/>
<field name="holiday_status_id"/>
<field name="name"/>
<field name="number_of_days" string="Number of Days" sum='Remaining Days'/>
<field name="date_from"/>
<field name="date_to"/>
<field name="name"/>
<field name="holiday_status_id"/>
<field name="manager_id" invisible="1"/>
<field name="user_id" invisible="1"/>
<field name="type"/>
<!--field name="type"/-->
<field name="state"/>
<button string="Confirm" name="confirm" states="draft" type="workflow" icon="gtk-yes" groups="base.group_hr_user,base.group_hr_manager"/>
<button string="Approve" name="validate" states="confirm" type="workflow" icon="gtk-apply" groups="base.group_hr_manager"/>
<button string="Refuse" name="refuse" states="confirm" type="workflow" icon="gtk-no" groups="base.group_hr_manager"/>
<button string="Cancel" name="cancel" states="validate,refuse,validate1" type="workflow" icon="gtk-cancel" groups="base.group_hr_manager"/>
<button string="Set to Draft" name="set_to_draft" states="cancel" type="object" icon="gtk-convert" groups="base.group_hr_manager"/>
</tree>
</field>
</record>
@ -245,7 +270,6 @@
<field name="view_type">form</field>
<field name="view_id" ref="edit_holiday_new"/>
<field name="domain">[('type','=','remove')]</field>
<field name="context">{'search_default_user_id':uid}</field>
<field name="search_view_id" ref="view_hr_holidays_filter"/>
<field name="help">Leaves requests can be recorded by employees and validated by their managers. Once a leave request is validated it appears automatically in the agenda of the employee. You can define several allowance types (paid holidays, sickness, etc) and manage allowances per type.</field>
</record>
@ -306,7 +330,7 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" eval="view_holiday_simple"/>
<field name="context">{'search_default_user_id':uid,'allocation_type':'company', 'report':True}</field>
<field name="context">{'allocation_type':'company', 'report':True}</field>
<field name="search_view_id" ref="view_hr_holidays_filter"/>
</record>
@ -355,7 +379,7 @@
<field name="view_mode">tree,form</field>
</record>
<menuitem sequence="3" id="hr.menu_open_view_attendance_reason_config" parent="hr.menu_hr_configuration" name="Leaves" groups="base.group_system"/>
<menuitem sequence="3" id="hr.menu_open_view_attendance_reason_config" parent="hr.menu_hr_configuration" name="Holidays" groups="base.group_system"/>
<menuitem name="Leave Type"
action="open_view_holiday_status"
id="menu_open_view_holiday_status"

View File

@ -11,6 +11,7 @@
id="menu_hr_reporting_holidays"
name="Holidays"
parent="hr.menu_hr_reporting"
sequence="6" />
sequence="6"
groups="base.group_hr_manager" />
</data>
</openerp>

View File

@ -35,6 +35,7 @@
<field name="max_leave" operator="+"/>
<field name="taken_leaves" operator="+"/>
<field name="remaining_leave" operator="+"/>
<field name="month" group = "True" operator="+" invisible="1"/>
<field group="True" name="holiday_status_id"/>
</graph>
</field>
@ -57,24 +58,24 @@
<separator orientation="vertical"/>
<field name="employee_id"/>
</group>
<newline/>
<group expand="0" string="Group By..." colspan="10" col="12">
<filter string="Department" icon="terp-personal+" context="{'group_by':'department_id'}"/>
<filter icon="terp-personal" string="Employee"
name="user" context="{'group_by':'employee_id'}"
help="Leaves by employee"/>
<separator orientation="vertical"/>
<filter string="Type" icon="terp-stock_symbol-selection" context="{'group_by':'holiday_status_id'}"/>
<separator orientation="vertical"/>
<filter string="Day" icon="terp-go-today" context="{'group_by':'day'}"/>
<filter string="Month" icon="terp-go-month" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
</group>
<newline/>
<group expand="0" string="Extended Filters..." colspan="10" col="12">
<field name="holiday_status_id" widget="selection"/>
<field name="department_id" widget="selection"/>
<field name="holiday_status_id" widget="selection"/>
<field name="department_id" widget="selection"/>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="10" col="12">
<filter string="Department" icon="terp-personal+" context="{'group_by':'department_id'}"/>
<filter icon="terp-personal" string="Employee"
name="user" context="{'group_by':'employee_id'}"
help="Leaves by employee"/>
<separator orientation="vertical"/>
<filter string="Type" icon="terp-stock_symbol-selection" context="{'group_by':'holiday_status_id'}"/>
<separator orientation="vertical"/>
<filter string="Day" icon="terp-go-today" context="{'group_by':'day'}"/>
<filter string="Month" icon="terp-go-month" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
</group>
</search>
</field>
</record>

View File

@ -29,6 +29,7 @@ class hr_holidays_report(osv.osv):
_rec_name = 'date'
_columns = {
'date': fields.date('Date', readonly=True),
'delay_approve': fields.float('Delay to Approve', digits=(16,2),readonly=True),
'year': fields.char('Year', size=4, readonly=True),
'day': fields.char('Day', size=15, readonly=True),
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
@ -68,7 +69,8 @@ class hr_holidays_report(osv.osv):
to_char(s.create_date, 'YYYY-MM-DD') as day,
s.holiday_status_id,
s.department_id,
s.state
s.state,
avg(extract('epoch' from age(s.create_date,CURRENT_DATE)))/(3600*24) as delay_approve
from
hr_holidays s
WHERE type='remove'

View File

@ -15,6 +15,7 @@
<field name="date_from" invisible="1"/>
<field name="date_to" invisible="1"/>
<field name="number_of_days_temp" sum="#Days"/>
<field name="delay_approve"/>
<field name="holiday_status_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="year" invisible="1"/>
@ -45,12 +46,11 @@
<field name="arch" type="xml">
<search string="Leaves">
<group>
<filter icon="terp-go-year" string="This Year"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]" help="Leaves in this year"/>
<filter icon="terp-go-month" string="This Month" name="month"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]" help="Leaves in this month"/>
<filter icon="terp-go-week" string=" 7 Days " separator="1"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]" help="Leaves during last 7 days"/>
<filter icon="terp-go-year" string=" Year "
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;=',time.strftime('%%Y-01-01'))]" help="Leaves taken in current year"/>
<filter icon="terp-go-month" string=" Month " name="month" domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;=',time.strftime('%%Y-%%m-01'))]" help="Leaves taken in current month"/>
<filter icon="terp-go-month" string=" Month-1 " separator="1"
domain="[('date','&lt;=', (datetime.date (int(time.strftime('%%Y')), datetime.date.today().month, 1) - datetime.timedelta (days = 1)).strftime('%%Y-%%m-%%d')),('date','&gt;',(datetime.date (int(time.strftime('%%Y')), datetime.date.today().month-1, 1)).strftime('%%Y-%%m-%%d'))]" help="Leaves taken in last month"/>
<separator orientation="vertical"/>
<filter string="Future Leaves" icon="terp-gtk-media-pause" domain="[('state', 'in' ,('draft','confirm'))]"
help = "Draft and Confirmed leaves"/>
@ -61,25 +61,7 @@
<field name="department_id"/>
<field name="employee_id"/>
</group>
<newline/>
<group expand="0" string="Group By..." colspan="10" col="12">
<filter string="Department" name="department" icon="terp-personal+" context="{'group_by':'department_id'}"/>
<separator orientation="vertical"/>
<filter icon="terp-personal" string="Employee" name="Employee" context="{'group_by':'employee_id'}"
help="Leaves by empolyee"/>
<filter string="User" name="User" icon="terp-personal" context="{'group_by':'user_id'}"/>
<separator orientation="vertical"/>
<filter icon="terp-stock_symbol-selection" string="Category" context="{'group_by':'category_id'}"
help="Leaves by category"/>
<filter string="Type" icon="terp-stock_symbol-selection" context="{'group_by':'holiday_status_id'}"/>
<separator orientation="vertical"/>
<filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
<separator orientation="vertical"/>
<filter string="Day" icon="terp-go-today" context="{'group_by':'day'}"/>
<filter string="Month" icon="terp-go-month" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
</group>
<newline/>
<newline/>
<group expand="0" string="Extended Filters..." colspan="10" col="12">
<field name="holiday_status_id"/>
<field name="category_id"/>
@ -89,6 +71,24 @@
<field name="date_from"/>
<field name="date_to"/>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="10" col="12">
<filter icon="terp-personal" string="Employee" name="Employee" context="{'group_by':'employee_id'}"
help="Leaves by empolyee"/>
<filter string="User" name="User" icon="terp-personal" context="{'group_by':'user_id'}"/>
<separator orientation="vertical"/>
<filter string="Department" name="department" icon="terp-personal+" context="{'group_by':'department_id'}"/>
<separator orientation="vertical"/>
<filter icon="terp-stock_symbol-selection" string="Category" context="{'group_by':'category_id'}"
help="Leaves by category"/>
<filter string="Type" icon="terp-stock_symbol-selection" context="{'group_by':'holiday_status_id'}"/>
<separator orientation="vertical"/>
<filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
<separator orientation="vertical"/>
<filter string="Day" icon="terp-go-today" context="{'group_by':'day'}" help="Group by create date"/>
<filter string="Month" icon="terp-go-month" context="{'group_by':'month'}" help="Group by month of create date"/>
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}" help="Group by year of create date"/>
</group>
</search>
</field>
</record>

View File

@ -1,11 +1,15 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_hr_holydays_status_user","hr.holidays.status user","model_hr_holidays_status","base.group_hr_user",1,0,0,0
"access_hr_holidays_user","hr.holidays.user","model_hr_holidays","base.group_hr_user",1,1,1,0
"access_hr_holydays_status_manager","hr.holidays.status.manager","model_hr_holidays_status","base.group_hr_manager",1,0,0,0
"access_hr_holidays_manager","hr.holidays.manager","model_hr_holidays","base.group_hr_manager",1,0,0,0
"access_hr_holydays_status_manager","hr.holidays.status.manager","model_hr_holidays_status","base.group_hr_manager",1,1,1,1
"access_hr_holidays_manager","hr.holidays.manager","model_hr_holidays","base.group_hr_manager",1,1,1,1
"access_hr_holidays_remain_user","hr.holidays.ramain.user","model_hr_holidays_remaining_leaves_user","base.group_hr_user",1,0,0,0
"access_hr_holidays_report","hr.holidays.report","model_hr_holidays_report","base.group_hr_manager",1,0,0,0
"access_hr_holidays_remaining_leaves_manager","hr.hr.holidays.remaining.leaves.manager","model_hr_holidays_remaining_leaves_user","base.group_hr_manager",1,0,0,0
"access_available_holidays_report","hr.available.holidays.report","model_available_holidays_report","base.group_hr_manager",1,0,0,0
"access_hr_holidays_report","hr.holidays.report","model_hr_holidays_report","base.group_hr_manager",1,1,1,1
"access_hr_holidays_remaining_leaves_manager","hr.hr.holidays.remaining.leaves.manager","model_hr_holidays_remaining_leaves_user","base.group_hr_manager",1,1,1,1
"access_available_holidays_report","hr.available.holidays.report","model_available_holidays_report","base.group_hr_manager",1,1,1,1
"access_hr_holydays_status_system","hr.holidays.status.system","model_hr_holidays_status","base.group_system",1,1,1,1
"access_hr_holidays_system","hr.holidays.system","model_hr_holidays","base.group_system",1,0,0,0
"access_hr_holidays_employee","hr.holidays.employee","model_hr_holidays","base.group_user",1,0,0,0
"access_hr_holydays_status_employee","hr.holidays.status.employee","model_hr_holidays_status","base.group_user",1,0,0,0
"access_resource_calendar_leaves_manager","resource_calendar_leaves_manager","resource.model_resource_calendar_leaves","base.group_hr_manager",1,1,1,1
"access_available_holidays_report_user","hr.available.holidays.report.user","model_available_holidays_report","base.group_hr_user",1,1,1,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_hr_holydays_status_user hr.holidays.status user model_hr_holidays_status base.group_hr_user 1 0 0 0
3 access_hr_holidays_user hr.holidays.user model_hr_holidays base.group_hr_user 1 1 1 0
4 access_hr_holydays_status_manager hr.holidays.status.manager model_hr_holidays_status base.group_hr_manager 1 0 1 0 1 0 1
5 access_hr_holidays_manager hr.holidays.manager model_hr_holidays base.group_hr_manager 1 0 1 0 1 0 1
6 access_hr_holidays_remain_user hr.holidays.ramain.user model_hr_holidays_remaining_leaves_user base.group_hr_user 1 0 0 0
7 access_hr_holidays_report hr.holidays.report model_hr_holidays_report base.group_hr_manager 1 0 1 0 1 0 1
8 access_hr_holidays_remaining_leaves_manager hr.hr.holidays.remaining.leaves.manager model_hr_holidays_remaining_leaves_user base.group_hr_manager 1 0 1 0 1 0 1
9 access_available_holidays_report hr.available.holidays.report model_available_holidays_report base.group_hr_manager 1 0 1 0 1 0 1
10 access_hr_holydays_status_system hr.holidays.status.system model_hr_holidays_status base.group_system 1 1 1 1
11 access_hr_holidays_system hr.holidays.system model_hr_holidays base.group_system 1 0 0 0
12 access_hr_holidays_employee hr.holidays.employee model_hr_holidays base.group_user 1 0 0 0
13 access_hr_holydays_status_employee hr.holidays.status.employee model_hr_holidays_status base.group_user 1 0 0 0
14 access_resource_calendar_leaves_manager resource_calendar_leaves_manager resource.model_resource_calendar_leaves base.group_hr_manager 1 1 1 1
15 access_available_holidays_report_user hr.available.holidays.report.user model_available_holidays_report base.group_hr_user 1 1 1 0

View File

@ -136,7 +136,8 @@ class hr_contract(osv.osv):
_columns = {
'permit_no':fields.char('Work Permit No', size=256, required=False, readonly=False),
'passport_id':fields.many2one('hr.passport', 'Passport', required=False),
# 'passport_id':fields.many2one('hr.passport', 'Passport', required=False),
'passport_id':fields.char('Passport',size=64, required=False),
'visa_no':fields.char('Visa No', size=64, required=False, readonly=False),
'visa_expire': fields.date('Visa Expire Date'),
'struct_id' : fields.many2one('hr.payroll.structure', 'Salary Structure'),
@ -145,6 +146,14 @@ class hr_contract(osv.osv):
_defaults = {
'working_days_per_week': lambda *a: 5,
}
def on_change_employee_id(self, cr, uid, ids, employee_id):
v = {}
passport = self.pool.get('hr.employee').browse(cr, uid, employee_id).passport_id
if passport:
v['passport_id'] = passport
return {'value': v}
hr_contract()
class payroll_register(osv.osv):
@ -293,7 +302,7 @@ class payroll_register(osv.osv):
pline = {
'advice_id':pid,
'name':slip.employee_id.otherid,
'name':slip.employee_id.identification_id,
'employee_id':slip.employee_id.id,
'amount':slip.other_pay + slip.net,
'bysal':slip.net
@ -423,7 +432,7 @@ class payroll_advice_line(osv.osv):
sids = slip_pool.search(cr, uid, [('paid','=',False),('state','=','confirm'),('date','>=',dates[0]), ('employee_id','=',employee_id), ('date','<=',dates[1])], context=context)
if sids:
slip = slip_pool.browse(cr, uid, sids[0], context=context)
vals['name'] = slip.employee_id.otherid
vals['name'] = slip.employee_id.identification_id
vals['amount'] = slip.net + slip.other_pay
vals['bysal'] = slip.net
return {
@ -1306,13 +1315,13 @@ class hr_employee(osv.osv):
_description = 'Employee'
_columns = {
'pan_no':fields.char('PAN No', size=64, required=False, readonly=False),
# 'pan_no':fields.char('PAN No', size=64, required=False, readonly=False),
'esp_account':fields.char('EPS Account', size=64, required=False, readonly=False, help="EPS Account"),
'pf_account':fields.char('PF Account', size=64, required=False, readonly=False, help="Providend Fund Account"),
'pg_joining': fields.date('PF Join Date'),
'esi_account':fields.char('ESI Account', size=64, required=False, readonly=False, help="ESI Account"),
'hospital_id':fields.many2one('res.partner.address', 'ESI Hospital', required=False),
'passport_id':fields.many2one('hr.passport', 'Passport', required=False),
'passport_id':fields.char('Passport', size=64),
'otherid':fields.char('Other Id', size=64, required=False),
'bank_account_id':fields.many2one('res.partner.bank', 'Bank Account', required=False, readonly=False),
'line_ids':fields.one2many('hr.payslip.line', 'employee_id', 'Salary Structure', required=False),

View File

@ -71,6 +71,7 @@
<record id="hr_contract_firstcontract1" model="hr.contract">
<field name="wage_type_id" ref="hr_contract.hr_contract_monthly_gross"/>
<field name="name">First Contract</field>
<field name="type_id" ref="hr_contract.hr_contract_type_emp"/>
<field name="date_start" eval="time.strftime('%Y-%m')+'-1'"/>
<field name="date_end" eval="time.strftime('%Y')+'-12-31'"/>
<field name="struct_id" ref="hr_payroll.structure_001"/>
@ -93,5 +94,112 @@
<field name="name">Salary Slip of Bonamy for June-2010</field>
</record>
<record id="ir_property_salaryaccount0" model="ir.property">
<field name="name">salary_account</field>
<field name="res_id">hr.employee,1</field>
<field name="company_id" ref="base.main_company"/>
<field name="fields_id" ref="hr_payroll.field_hr_employee_salary_account"/>
<field name="value_reference">account.account,27</field>
<field name="type">many2one</field>
</record>
<record id="ir_property_employeeaccount0" model="ir.property">
<field name="name">employee_account</field>
<field name="res_id">hr.employee,1</field>
<field name="company_id" ref="base.main_company"/>
<field name="fields_id" ref="hr_payroll.field_hr_employee_employee_account"/>
<field name="value_reference">account.account,22</field>
<field name="type">many2one</field>
</record>
<record id="ir_property_propertybankaccount0" model="ir.property">
<field name="name">property_bank_account</field>
<field name="res_id">hr.employee,1</field>
<field name="company_id" ref="base.main_company"/>
<field name="fields_id" ref="hr_payroll.field_hr_employee_property_bank_account"/>
<field name="value_reference">account.account,11</field>
<field name="type">many2one</field>
</record>
<record id="ir_property_salaryaccount2" model="ir.property">
<field name="name">salary_account</field>
<field name="res_id">hr.employee,2</field>
<field name="company_id" ref="base.main_company"/>
<field name="fields_id" ref="hr_payroll.field_hr_employee_salary_account"/>
<field name="value_reference">account.account,27</field>
<field name="type">many2one</field>
</record>
<record id="ir_property_employeeaccount2" model="ir.property">
<field name="name">employee_account</field>
<field name="res_id">hr.employee,2</field>
<field name="company_id" ref="base.main_company"/>
<field name="fields_id" ref="hr_payroll.field_hr_employee_employee_account"/>
<field name="value_reference">account.account,22</field>
<field name="type">many2one</field>
</record>
<record id="ir_property_propertybankaccount2" model="ir.property">
<field name="name">property_bank_account</field>
<field name="res_id">hr.employee,2</field>
<field name="company_id" ref="base.main_company"/>
<field name="fields_id" ref="hr_payroll.field_hr_employee_property_bank_account"/>
<field name="value_reference">account.account,11</field>
<field name="type">many2one</field>
</record>
<record id="ir_property_salaryaccount3" model="ir.property">
<field name="name">salary_account</field>
<field name="res_id">hr.employee,3</field>
<field name="company_id" ref="base.main_company"/>
<field name="fields_id" ref="hr_payroll.field_hr_employee_salary_account"/>
<field name="value_reference">account.account,27</field>
<field name="type">many2one</field>
</record>
<record id="ir_property_employeeaccount3" model="ir.property">
<field name="name">employee_account</field>
<field name="res_id">hr.employee,3</field>
<field name="company_id" ref="base.main_company"/>
<field name="fields_id" ref="hr_payroll.field_hr_employee_employee_account"/>
<field name="value_reference">account.account,22</field>
<field name="type">many2one</field>
</record>
<record id="ir_property_propertybankaccount3" model="ir.property">
<field name="name">property_bank_account</field>
<field name="res_id">hr.employee,3</field>
<field name="company_id" ref="base.main_company"/>
<field name="fields_id" ref="hr_payroll.field_hr_employee_property_bank_account"/>
<field name="value_reference">account.account,11</field>
<field name="type">many2one</field>
</record>
<record id="ir_property_salaryaccount4" model="ir.property">
<field name="name">salary_account</field>
<field name="res_id">hr.employee,10</field>
<field name="company_id" ref="base.main_company"/>
<field name="fields_id" ref="hr_payroll.field_hr_employee_salary_account"/>
<field name="value_reference">account.account,27</field>
<field name="type">many2one</field>
</record>
<record id="ir_property_employeeaccount4" model="ir.property">
<field name="name">employee_account</field>
<field name="res_id">hr.employee,10</field>
<field name="company_id" ref="base.main_company"/>
<field name="fields_id" ref="hr_payroll.field_hr_employee_employee_account"/>
<field name="value_reference">account.account,22</field>
<field name="type">many2one</field>
</record>
<record id="ir_property_propertybankaccount4" model="ir.property">
<field name="name">property_bank_account</field>
<field name="res_id">hr.employee,10</field>
<field name="company_id" ref="base.main_company"/>
<field name="fields_id" ref="hr_payroll.field_hr_employee_property_bank_account"/>
<field name="value_reference">account.account,11</field>
<field name="type">many2one</field>
</record>
</data>
</openerp>

View File

@ -2,7 +2,7 @@
<openerp>
<data>
<!-- Root Menus -->
<menuitem id="menu_hr_root_payroll" parent="hr.menu_hr_root" name="Payroll"/>
<menuitem id="menu_hr_root_payroll" parent="hr.menu_hr_root" name="Payroll" groups="base.group_system,group_hr_payroll" sequence="9"/>
<menuitem id="payroll_configure" parent="hr.menu_hr_configuration" name="Payroll" groups="base.group_system"/>
<menuitem id="menu_hr_payroll_reporting" parent="hr.menu_hr_reporting" name="Payroll" groups="base.group_hr_manager"/>
@ -84,12 +84,6 @@
<field name="view_id" ref="hr_passport_tree"/>
<field name="search_view_id" ref="view_hr_passport_filter"/>
</record>
<menuitem id="passport_configure" parent="hr.menu_hr_configuration" name="Passport"/>
<menuitem
id="menu_action_hr_passport_tree"
action="action_hr_passport_tree"
parent="passport_configure"
/>
<!-- End Passport Views -->
<!-- Employee View -->
@ -98,7 +92,35 @@
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<page string="Notes" position="before">
<data>
<xpath expr="/form/notebook/page[@string='Personal Information']" position="after">
<page string="Miscellaneous">
<group colspan="2" col="2">
<separator string="Personal Info" colspan="2"/>
<field name="otherid" select="1"/>
<field name="bank_account_id"/>
<field name="place_of_birth"/>
<field name="children"/>
</group>
<group colspan="2" col="2">
<separator string="Job Info" colspan="2"/>
<field name="manager" select="1"/>
<field name="vehicle" select="1"/>
<field name="vehicle_distance" select="1"/>
</group>
<group col="2" colspan="2">
<separator colspan="2" string="ESI Information"/>
<field name="esi_account" string="Account"/>
<field name="hospital_id" string="Hospital"/>
<field name="medic_exam" select="1" string="Medical Examination"/>
<field name="esp_account" select="1"/>
</group>
<group col="2" colspan="2">
<separator colspan="2" string="Providend Fund"/>
<field name="pf_account" string="Account"/>
<field name="pg_joining" string="Join Date"/>
</group>
</page>
<page string="Contracts">
<field colspan="4" mode="form,tree" name="contract_ids" nolabel="1">
<tree string="Contracts">
@ -153,33 +175,8 @@
</form>
</field>
</page>
<page string="Miscellaneous">
<group colspan="2" col="2">
<separator string="Personal Info" colspan="2"/>
<field name="pan_no" select="1"/>
<field name="bank_account_id"/>
<field name="place_of_birth"/>
<field name="children"/>
</group>
<group colspan="2" col="2">
<separator string="Job Info" colspan="2"/>
<field name="manager" select="1"/>
<field name="vehicle" select="1"/>
<field name="vehicle_distance" select="1"/>
</group>
<group col="2" colspan="2">
<separator colspan="2" string="ESI Information"/>
<field name="esi_account" string="Account"/>
<field name="hospital_id" string="Hospital"/>
<field name="medic_exam" select="1" string="Medical Examination"/>
<field name="esp_account" select="1"/>
</group>
<group col="2" colspan="2">
<separator colspan="2" string="Providend Fund"/>
<field name="pf_account" string="Account"/>
<field name="pg_joining" string="Join Date"/>
</group>
</page>
</xpath>
<xpath expr="/form/notebook/page[@string='Notes']" position="before">
<page string="Salary Structure">
<field name="line_ids" nolabel="1" colspan="4" string="Salary Structure">
<tree string="Salary Structure" editable="bottom">
@ -202,7 +199,8 @@
<field name="analytic_account" groups="base.group_extended"/>
<field name="slip_ids" colspan="4" nolabel="1"/>
</page>
</page>
</xpath>
</data>
</field>
</record>
@ -212,13 +210,12 @@
<field name="type">form</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<field name="otherid" position="after">
<field name="identification_id" position="after">
<field name="passport_id"/>
</field>
</field>
</record>
<!-- End Employee View -->
<!-- Contract View -->
<record id="hr_contract.hr_contract_view_form" model="ir.ui.view">
<field name="name">hr.contract.view.form</field>
@ -228,7 +225,7 @@
<form string="Contract">
<group colspan="4" col="6">
<field name="name" select="1"/>
<field name="employee_id" select="1"/>
<field name="employee_id" select="1" on_change="on_change_employee_id(employee_id)"/>
<field name="job_id"/>
<field name="wage"/>
<field name="wage_type_id" widget="selection"/>
@ -242,6 +239,9 @@
<field name="date_end" select="1"/>
<field name="working_hours"/>
<field name="working_days_per_week" select="1"/>
<separator colspan="2" string="Trial Period"/>
<field name="trial_date_start" />
<field name="trial_date_end" />
</group>
<group col="2" colspan="2">
<separator colspan="2" string="Advantages"/>

View File

@ -25,10 +25,32 @@
"access_account_journal_column_payroll","account.journal.column.payroll","account.model_account_journal_column","group_hr_payroll",1,0,0,0
"access_account_fiscalyear_payroll","account.fiscalyear.payroll","account.model_account_fiscalyear","group_hr_payroll",1,0,0,0
"access_hr_payslip_contract","hr.payslip.contract","model_hr_payslip","base.group_hr_contract",1,0,0,0
"access_hr_payroll_structure","hr.payroll.structure","model_hr_payroll_structure","base.group_system",1,1,1,1
"access_hr_payroll_structure_system","hr.payroll.structure.system","model_hr_payroll_structure","base.group_system",1,1,1,1
"access_company_contribution","company.contribution","model_company_contribution","base.group_system",1,1,1,1
"access_hr_passport_sys","hr.passport","model_hr_passport","base.group_system",1,1,1,1
"access_res_partner_payroll","res.partner.payroll","base.model_res_partner","group_hr_payroll",1,1,1,1
"access_hr_contibution_register_system","hr.contibution.register.system","model_hr_contibution_register","base.group_system",1,1,1,1
"access_hr_contibution_register_line_system","hr.contibution.register.line.system","model_hr_contibution_register_line","base.group_system",1,1,1,1
"access_hr_allounce_deduction_category_system","hr.allounce.deduction.category.system","model_hr_allounce_deduction_categoty","base.group_system",1,1,1,1
"access_account_fiscalyear_manager","account.fiscalyear.payroll.manager","account.model_account_fiscalyear","base.group_hr_manager",1,1,1,1
"access_hr_payslip_manager","hr.payslip.manager","model_hr_payslip","base.group_hr_manager",1,1,1,1
"access_hr_payslip_line_manager","hr.payslip.line.manager","model_hr_payslip_line","base.group_hr_manager",1,1,1,1
"access_hr_payroll_structure_manager","hr.payroll.structure.manager","model_hr_payroll_structure","base.group_hr_manager",1,1,1,1
"access_hr_allounce_deduction_category_manager","hr.allounce.deduction.category.manager","model_hr_allounce_deduction_categoty","base.group_hr_manager",1,1,1,1
"access_hr_passport_manager","hr.passport.manager","model_hr_passport","base.group_hr_manager",1,1,1,1
"access_account_journal_manager","account.journal.manager","account.model_account_journal","base.group_hr_manager",1,1,1,1
"access_account_journal_column_manager","account.journal.column.manager","account.model_account_journal_column","base.group_hr_manager",1,1,1,1
"access_account_journal_view_manager","account.journal.view.manager","account.model_account_journal_view","base.group_hr_manager",1,1,1,1
"access_hr_payslip_employee","hr.payslip.employee","model_hr_payslip","base.group_user",1,0,0,0
"access_hr_payroll_register_system","hr.payroll.register.system","model_hr_payroll_register","base.group_system",1,0,0,0
"access_hr_payroll_advice_system","hr.payroll.advice.system","model_hr_payroll_advice","base.group_system",1,0,0,0
"access_hr_payslip_line_system","hr.payslip.line.system","model_hr_payslip_line","base.group_system",1,1,1,1
"access_hr_payslip_account_move_system","hr.payslip.account.move.system","model_hr_payslip_account_move","base.group_system",1,0,0,0
"access_hr_payroll_structure_contract","hr.payroll.structure.contract","model_hr_payroll_structure","base.group_hr_contract",1,1,1,1
"access_hr_payslip_line_user","hr.payslip.line.user","model_hr_payslip_line","base.group_hr_user",1,1,1,0
"access_hr_allounce_deduction_category_hr_user","hr.allounce.deduction.category.hr.user","model_hr_allounce_deduction_categoty","base.group_hr_user",1,1,1,0
"access_hr_payroll_structure_hr_user","hr.payroll.structure.hr.user","model_hr_payroll_structure","base.group_hr_user",1,1,1,0
"access_hr_payslip_line_line_hr_user","hr.payslip.line.line.hr.user","model_hr_payslip_line_line","base.group_hr_user",1,1,1,0
"access_hr_payslip_line_line_hr_manager","hr.payslip.line.line.hr.manager","model_hr_payslip_line_line","base.group_hr_manager",1,1,1,1
"access_hr_payslip_line_line_system","hr.payslip.line.line.system","model_hr_payslip_line_line","base.group_system",1,0,0,0
"access_hr_payroll_advice_line_system","hr.payroll.advice.line.system","model_hr_payroll_advice_line","base.group_system",1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
25 access_account_journal_column_payroll account.journal.column.payroll account.model_account_journal_column group_hr_payroll 1 0 0 0
26 access_account_fiscalyear_payroll account.fiscalyear.payroll account.model_account_fiscalyear group_hr_payroll 1 0 0 0
27 access_hr_payslip_contract hr.payslip.contract model_hr_payslip base.group_hr_contract 1 0 0 0
28 access_hr_payroll_structure access_hr_payroll_structure_system hr.payroll.structure hr.payroll.structure.system model_hr_payroll_structure base.group_system 1 1 1 1
29 access_company_contribution company.contribution model_company_contribution base.group_system 1 1 1 1
30 access_hr_passport_sys hr.passport model_hr_passport base.group_system 1 1 1 1
31 access_res_partner_payroll res.partner.payroll base.model_res_partner group_hr_payroll 1 1 1 1
32 access_hr_contibution_register_system hr.contibution.register.system model_hr_contibution_register base.group_system 1 1 1 1
33 access_hr_contibution_register_line_system hr.contibution.register.line.system model_hr_contibution_register_line base.group_system 1 1 1 1
34 access_hr_allounce_deduction_category_system hr.allounce.deduction.category.system model_hr_allounce_deduction_categoty base.group_system 1 1 1 1
35 access_account_fiscalyear_manager account.fiscalyear.payroll.manager account.model_account_fiscalyear base.group_hr_manager 1 1 1 1
36 access_hr_payslip_manager hr.payslip.manager model_hr_payslip base.group_hr_manager 1 1 1 1
37 access_hr_payslip_line_manager hr.payslip.line.manager model_hr_payslip_line base.group_hr_manager 1 1 1 1
38 access_hr_payroll_structure_manager hr.payroll.structure.manager model_hr_payroll_structure base.group_hr_manager 1 1 1 1
39 access_hr_allounce_deduction_category_manager hr.allounce.deduction.category.manager model_hr_allounce_deduction_categoty base.group_hr_manager 1 1 1 1
40 access_hr_passport_manager hr.passport.manager model_hr_passport base.group_hr_manager 1 1 1 1
41 access_account_journal_manager account.journal.manager account.model_account_journal base.group_hr_manager 1 1 1 1
42 access_account_journal_column_manager account.journal.column.manager account.model_account_journal_column base.group_hr_manager 1 1 1 1
43 access_account_journal_view_manager account.journal.view.manager account.model_account_journal_view base.group_hr_manager 1 1 1 1
44 access_hr_payslip_employee hr.payslip.employee model_hr_payslip base.group_user 1 0 0 0
45 access_hr_payroll_register_system hr.payroll.register.system model_hr_payroll_register base.group_system 1 0 0 0
46 access_hr_payroll_advice_system hr.payroll.advice.system model_hr_payroll_advice base.group_system 1 0 0 0
47 access_hr_payslip_line_system hr.payslip.line.system model_hr_payslip_line base.group_system 1 1 1 1
48 access_hr_payslip_account_move_system hr.payslip.account.move.system model_hr_payslip_account_move base.group_system 1 0 0 0
49 access_hr_payroll_structure_contract hr.payroll.structure.contract model_hr_payroll_structure base.group_hr_contract 1 1 1 1
50 access_hr_payslip_line_user hr.payslip.line.user model_hr_payslip_line base.group_hr_user 1 1 1 0
51 access_hr_allounce_deduction_category_hr_user hr.allounce.deduction.category.hr.user model_hr_allounce_deduction_categoty base.group_hr_user 1 1 1 0
52 access_hr_payroll_structure_hr_user hr.payroll.structure.hr.user model_hr_payroll_structure base.group_hr_user 1 1 1 0
53 access_hr_payslip_line_line_hr_user hr.payslip.line.line.hr.user model_hr_payslip_line_line base.group_hr_user 1 1 1 0
54 access_hr_payslip_line_line_hr_manager hr.payslip.line.line.hr.manager model_hr_payslip_line_line base.group_hr_manager 1 1 1 1
55 access_hr_payslip_line_line_system hr.payslip.line.line.system model_hr_payslip_line_line base.group_system 1 0 0 0
56 access_hr_payroll_advice_line_system hr.payroll.advice.line.system model_hr_payroll_advice_line base.group_system 1 0 0 0

View File

@ -16,6 +16,7 @@
name: reference
wage: 5000.0
wage_type_id: hr_contract.hr_contract_monthly_gross
type_id: hr_contract.hr_contract_type_emp
country_id: base.in
department_id: hr.dep_it
employee_account: account.a_recv

View File

@ -15,6 +15,7 @@
name: reference
wage: 5000.0
wage_type_id: hr_contract.hr_contract_monthly_gross
type_id: hr_contract.hr_contract_type_emp
country_id: base.in
department_id: hr.dep_it
employee_account: account.a_recv

View File

@ -25,6 +25,7 @@
name: reference
wage: 5000.0
wage_type_id: hr_contract.hr_contract_monthly_gross
type_id: hr_contract.hr_contract_type_emp
country_id: base.in
department_id: hr.dep_it
employee_account: account.a_recv

View File

@ -41,8 +41,8 @@ system to store and search in your CV base.
'hr_recruitment_menu.xml',
'security/hr_recruitment_security.xml',
'security/ir.model.access.csv',
'board_hr_recruitment_statistical_view.xml',
'report/hr_recruitment_report_view.xml',
'board_hr_recruitment_statistical_view.xml',
],
'init_xml': [
'hr_recruitment_data.xml'

View File

@ -30,7 +30,7 @@
<record id="board_hr_applicants_status_form" model="ir.ui.view">
<field name="name">board.hr.applicants.status.form</field>
<field name="model">board.board</field>
<field name="inherit_id" ref="hr.board_hr_form"/>
<field name="inherit_id" ref="hr.board_hr_manager_form"/>
<field name="type">form</field>
<field name="arch" type="xml">
<xpath expr="/form/hpaned/child2" position="inside">
@ -38,6 +38,13 @@
</xpath>
</field>
</record>
<menuitem id="base.menu_hr_dasboard" name="Dashboard" parent="hr.menu_hr_reporting" sequence="0" groups="base.group_system,base.group_hr_manager,base.group_hr_user"/>
<menuitem
action="hr.open_board_hr_manager"
icon="terp-graph"
id="base.menu_hr_manager"
parent="base.menu_hr_dasboard"
groups = "base.group_hr_manager"
sequence="5"/>
</data>
</openerp>

View File

@ -422,10 +422,23 @@ class hr_applicant(crm.crm_case, osv.osv):
@param ids: List of case's Ids
@param *args: Give Tuple Value
"""
employee_obj = self.pool.get('hr.employee')
job_obj = self.pool.get('hr.job')
res = super(hr_applicant, self).case_close(cr, uid, ids, *args)
for (id, name) in self.name_get(cr, uid, ids):
message = _('Applicant ') + " '" + name + "' "+ _("is Hired.")
self.log(cr, uid, id, message)
stage_id = self.pool.get('hr.recruitment.stage').search(cr, uid, [('name','=','Contract Signed')])
self.write(cr, uid, ids,{'stage_id':stage_id[0]})
applicant = self.browse(cr, uid, ids)[0]
if applicant.job_id :
emp_id = employee_obj.create(cr,uid,{'name':applicant.name,'job_id':applicant.job_id.id})
job_data = job_obj.browse(cr,uid, applicant.job_id.id)
expected_emp = job_data['expected_employees'] - 1
job_obj.write(cr,uid, [applicant.job_id.id],{'expected_employees':expected_emp,'state': 'old'})
return res
def case_reset(self, cr, uid, ids, *args):

View File

@ -6,11 +6,6 @@
name="Recruitment"
parent="hr.menu_hr_configuration"
sequence="2"/>
<menuitem
id="menu_hr_config_applicant"
name="Applicant"
parent="menu_hr_recruitment_recruitment"
sequence="2"/>
# ------------------------------------------------------
# Job Categories
@ -35,7 +30,6 @@
<field name="context">{}</field>
</record>
<menuitem action="hr_job_stage_act" id="menu_hr_job_stage_act" name="Stages" parent="menu_hr_config_applicant"/>
# ------------------------------------------------------
# Jobs
@ -83,8 +77,8 @@
<field name="name" string="Subject"/>
<field name="partner_name"/>
<field name="job_id" on_change="onchange_job(job_id)"/>
<button string="Schedule a Phone Call" name="%(action_hr_recruitment_phonecall)d" icon="gtk-redo" type="action"/>
<button name="action_makeMeeting" type="object" string="Schedule Meeting" icon="terp-hr"/>
<button string="Schedule a Phone Call" name="%(action_hr_recruitment_phonecall)d" icon="terp-call-start" type="action" groups="base.group_extended"/>
<button name="action_makeMeeting" type="object" string="Schedule Meeting" icon="gtk-index"/>
<newline/>
<field name="department_id" widget="selection"/>
<group colspan="2" col="4">
@ -106,7 +100,7 @@
<field name="partner_id" on_change="onchange_partner_id(partner_id, email_from)" />
<button string="Create Partner"
name="%(action_hr_recruitment_partner_create)d"
icon="terp-mail-replied" type="action" attrs="{'readonly':[('partner_id','!=',False)]}"/>
icon="gtk-index" type="action" attrs="{'readonly':[('partner_id','!=',False)]}"/>
<newline/>
<field name="partner_address_id" on_change="onchange_partner_address_id(partner_address_id, email_from)" colspan="3"/>
<field name="email_from" colspan="3"/>

View File

@ -23,10 +23,10 @@ from osv import fields,osv
from hr_recruitment import hr_recruitment
AVAILABLE_STATES = [
('draft','Draft'),
('draft','New'),
('open','Open'),
('cancel', 'Cancelled'),
('done', 'Closed'),
('cancel', 'Refused'),
('done', 'Hired'),
('pending','Pending')
]
@ -69,10 +69,11 @@ class hr_recruitment_report(osv.osv):
'date_closed': fields.date('Closed', readonly=True),
'job_id': fields.many2one('hr.job', 'Applied Job',readonly=True),
'stage_id': fields.many2one ('hr.recruitment.stage', 'Stage'),
'type_id': fields.many2one('crm.case.resource.type', 'Degree', domain="[('object_id.model', '=', 'hr.applicant')]"),
'type_id': fields.many2one('hr.recruitment.degree', 'Degree'),
'department_id':fields.many2one('hr.department','Department',readonly=True),
'priority': fields.selection(hr_recruitment.AVAILABLE_PRIORITIES, 'Appreciation'),
'salary_prop' : fields.float("Salary Proposed"),
'salary_prop_avg' : fields.float("Avg Salary Proposed", group_operator="avg"),
'salary_exp' : fields.float("Salary Expected"),
'partner_id': fields.many2one('res.partner', 'Partner',readonly=True),
'partner_address_id': fields.many2one('res.partner.address', 'Partner Contact Name',readonly=True),
@ -107,6 +108,7 @@ class hr_recruitment_report(osv.osv):
s.priority,
s.stage_id,
sum(salary_proposed) as salary_prop,
(sum(salary_proposed)/count(*)) as salary_prop_avg,
sum(salary_expected) as salary_exp,
extract('epoch' from (s.date_open-s.create_date))/(3600*24) as delay_open,
extract('epoch' from (s.date_closed-s.create_date))/(3600*24) as delay_close,

View File

@ -21,11 +21,12 @@
<field name="day" invisible="1"/>
<field name="month" invisible="1"/>
<field name="nbr" sum="# Cases"/>
<field name="salary_prop" sum="Salary Proposed" />
<field name="salary_exp" sum="Salary Expected"/>
<field name="delay_open" avg='Avg Opening Delay'/>
<field name="delay_close" avg='Avg Closing Delay'/>
<field name="available" sum="Available"/>
<field name="salary_exp" sum="Expected Salary"/>
<field name="salary_prop" sum="Proposed Salary" />
<field name="salary_prop_avg" sum="Avg Proposed Salary" />
<field name="delay_open" avg='Avg Delay to Open'/>
<field name="delay_close" avg='Avg Delay to Close'/>
</tree>
</field>
</record>
@ -49,18 +50,18 @@
<field name="arch" type="xml">
<search string="Recruitment Analysis">
<group>
<filter icon="terp-go-year" string="365 Days"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
help="Recruitment performed in last 356 days"/>
<filter icon="terp-go-month" string="30 Days"
<filter icon="terp-go-year" string="Year"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;=',time.strftime('%%Y-01-01'))]"
help="Recruitment performed in current year"/>
<filter icon="terp-go-month" string="Month"
name="month"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
help="Recruitment performed in this month"/>
<filter icon="terp-go-week"
string=" 7 Days "
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;=',time.strftime('%%Y-%%m-01'))]"
help="Recruitment performed in current month"/>
<filter icon="terp-go-month"
string=" Month-1 "
separator="1"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
help="Recruitment during last 7 days"/>
domain="[('date','&lt;=', (datetime.date (int(time.strftime('%%Y')), datetime.date.today().month, 1) - datetime.timedelta (days = 1)).strftime('%%Y-%%m-%%d')),('date','&gt;',(datetime.date (int(time.strftime('%%Y')), datetime.date.today().month-1, 1)).strftime('%%Y-%%m-%%d'))]"
help="Recruitment during last month"/>
<separator orientation="vertical"/>
<filter string="New"
icon="terp-document-new"
@ -74,50 +75,52 @@
icon="terp-gtk-media-pause"
domain="[('state','=','pending')]"
help = "Pending recruitment"/>
<filter string="Hired"
icon="terp-camera_test"
domain="[('state','=','done')]"
help = "Hired employees"/>
<separator orientation="vertical"/>
<field name="job_id"/>
<field name="department_id" widget="selection"/>
<field name="user_id">
<filter icon="terp-hr"
<field name="user_id" string="Responsible">
<filter icon="terp-personal"
string="My Recruitment"
help="My Recruitment"
domain="[('user_id','=',uid)]"/>
</field>
</group>
<newline/>
<group expand="0" string="Group By ...">
<filter string="User" name='User' icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="job_id" widget="selection"/>
<field name="type_id" widget="selection"/>
<field name="priority"/>
<field name="stage_id" widget="selection"/>
<field name="state"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<newline/>
<field name="date"/>
<field name="date_closed"/>
</group>
<newline/>
<group expand="1" string="Group By ...">
<filter string="Responsible" name='User' icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<filter string="Company" icon="terp-go-home" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<filter string="Partner" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}" />
<separator orientation="vertical"/>
<filter string="Jobs" name="job" icon="terp-gtk-select-all" domain="[]" context="{'group_by':'job_id'}"/>
<filter string="Department" name="department" icon="terp-personal+" domain="[]" context="{'group_by':'department_id'}"/>
<separator orientation="vertical"/>
<filter string="Degree" name="degree" icon="terp-gtk-select-all" domain="[]" context="{'group_by':'type_id'}"/>
<separator orientation="vertical"/>
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
<filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}" />
<separator orientation="vertical"/>
<filter string="Jobs" name="job" icon="terp-gtk-select-all" domain="[]" context="{'group_by':'job_id'}"/>
<filter string="Department" name="department" icon="terp-personal+" domain="[]" context="{'group_by':'department_id'}"/>
<filter string="Degree" name="degree" icon="terp-gtk-select-all" domain="[]" context="{'group_by':'type_id'}"/>
<separator orientation="vertical"/>
<filter string="Day" name = "day" icon="terp-go-today" domain="[]" context="{'group_by':'day'}"/>
<filter string="Month" icon="terp-go-month" domain="[]" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-go-year" domain="[]" context="{'group_by':'year'}"/>
</group>
<newline/>
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="state"/>
<separator orientation="vertical"/>
<field name="date"/>
<separator orientation="vertical"/>
<field name="stage_id" widget="selection"/>
<field name="type_id" widget="selection"/>
<newline/>
<field name="priority"/>
<separator orientation="vertical"/>
<field name="date_closed"/>
<separator orientation="vertical"/>
<field name="job_id" widget="selection"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</group>
</search>
</field>
</record>
@ -127,10 +130,10 @@
<field name="res_model">hr.recruitment.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="context">{'search_default_month':1,'search_default_User':1,'search_default_user_id':uid,'group_by_no_leaf':1,'group_by':[]}</field>
<field name="context">{'search_default_month':1,'search_default_department':1,'group_by_no_leaf':1,'group_by':[]}</field>
<field name="search_view_id" ref="view_hr_recruitment_report_search"/>
</record>
<menuitem id="hr.menu_hr_reporting" name="Reporting" parent="hr.menu_hr_root" sequence="10" groups="base.group_hr_manager"/>
<menuitem id="hr.menu_hr_reporting" name="Reporting" parent="hr.menu_hr_root" sequence="10" groups="base.group_hr_manager,base.group_hr_user"/>
<menuitem action="action_hr_recruitment_report_all" id="menu_hr_recruitment_report_all" parent="hr.menu_hr_reporting" sequence="1"/>
</data>

View File

@ -1,9 +1,10 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_hr_applicant_user","hr.applicant.user","model_hr_applicant","base.group_hr_user",1,1,1,1
"access_hr_recruitment_report","hr.recruitment.report","model_hr_recruitment_report","base.group_hr_manager",1,0,0,0
"access_hr_recruitment_report","hr.recruitment.report","model_hr_recruitment_report","base.group_hr_manager",1,1,1,1
"access_hr_recruitment_stage_user","hr.recruitment.stage.user","model_hr_recruitment_stage","base.group_hr_user",1,1,1,1
"access_hr_recruitment_degree","hr.recruitment.degree","model_hr_recruitment_degree","base.group_hr_user",1,1,1,1
"access_hr_recruitment_stage_system","hr.recruitment.stage.system","model_hr_recruitment_stage","base.group_system",1,1,1,1
"access_hr_applicant_manager","hr.applicant.manager","model_hr_applicant","base.group_hr_manager",1,0,0,0
"access_hr_applicant_manager","hr.applicant.manager","model_hr_applicant","base.group_hr_manager",1,1,1,1
"access_hr_applicant_system","hr.applicant.system","model_hr_applicant","base.group_system",1,0,0,0
"access_hr_recruitment_stage_manager","hr.recruitment.stage.manager","model_hr_recruitment_stage","base.group_hr_manager",1,0,0,0
"access_hr_recruitment_stage_manager","hr.recruitment.stage.manager","model_hr_recruitment_stage","base.group_hr_manager",1,1,1,1
"access_hr_recruitment_degree_manager","hr.recruitment.degree.manager","model_hr_recruitment_degree","base.group_hr_manager",1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_hr_applicant_user hr.applicant.user model_hr_applicant base.group_hr_user 1 1 1 1
3 access_hr_recruitment_report hr.recruitment.report model_hr_recruitment_report base.group_hr_manager 1 0 1 0 1 0 1
4 access_hr_recruitment_stage_user hr.recruitment.stage.user model_hr_recruitment_stage base.group_hr_user 1 1 1 1
5 access_hr_recruitment_degree hr.recruitment.degree model_hr_recruitment_degree base.group_hr_user 1 1 1 1
6 access_hr_recruitment_stage_system hr.recruitment.stage.system model_hr_recruitment_stage base.group_system 1 1 1 1
7 access_hr_applicant_manager hr.applicant.manager model_hr_applicant base.group_hr_manager 1 0 1 0 1 0 1
8 access_hr_applicant_system hr.applicant.system model_hr_applicant base.group_system 1 0 0 0
9 access_hr_recruitment_stage_manager hr.recruitment.stage.manager model_hr_recruitment_stage base.group_hr_manager 1 0 1 0 1 0 1
10 access_hr_recruitment_degree_manager hr.recruitment.degree.manager model_hr_recruitment_degree base.group_hr_manager 1 1 1 1

View File

@ -98,7 +98,7 @@ class job2phonecall(osv.osv_memory):
new_phonecall = phonecall_case_obj.browse(cr, uid, new_phonecall_id, context=context)
vals = {}
job_case_obj.write(cr, uid, [job.id], vals, context=context)
job_case_obj.case_cancel(cr, uid, [job.id])
# job_case_obj.case_cancel(cr, uid, [job.id])
phonecall_case_obj.case_open(cr, uid, [new_phonecall_id])
return {

View File

@ -16,8 +16,8 @@
<field name="date" on_change="on_change_date(date)"/>
<field domain="[('type','=','normal'),('state', '&lt;&gt;', 'close')]" name="account_id"/>
<field name="name"/>
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" sum="Total time"/>
<field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" required="1" domain="[('type','=','service')]"/>
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" sum="Total time"/>
<field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)"/>
<field name="amount" sum="Total cost"/>
<field name="general_account_id"/>
@ -67,16 +67,22 @@
<field name="arch" type="xml">
<search string="Timesheet">
<group col='8' colspan='4'>
<filter icon="terp-personal+"
domain="[('user_id','=',uid)]"
string="My Working Hours" name="my" default="1"/>
<separator orientation="vertical"/>
<filter icon="terp-go-today" domain="[('date', '=', time.strftime('%%Y-%%m-%%d'))]" string="Today"/>
<separator orientation="vertical"/>
<field name="user_id"/>
<field name="account_id" select="1" widget="selection"/>
<field name="product_id" select="1"/>
<field name="date" select="1"/>
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="Users" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<separator orientation="vertical"/>
<filter string="Anlytic account" icon="terp-folder-green" domain="[]" context="{'group_by':'account_id'}"/>
<filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
<separator orientation="vertical"/>
<filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'date'}"/>
</group>
</search>
</field>
@ -113,7 +119,7 @@
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<page string="Notes" position="before">
<page string="Categories" position="after">
<page string="Timesheets">
<field name="product_id" domain="[('type','=','service')]"/>
<field name="journal_id"/>

View File

@ -5,6 +5,12 @@
"access_product_product_user","product.product user","product.model_product_product","base.group_hr_user",1,0,0,0
"access_product_template_hr_timesheet","product.template.hr.timesheet","product.model_product_template","base.group_hr_user",1,0,0,0
"access_product_uom_hr_timesheet","product.uom.hr.timesheet","product.model_product_uom","base.group_hr_user",1,0,0,0
"access_hr_analytic_timesheet_manager","hr.analytic.timesheet.manager","model_hr_analytic_timesheet","base.group_hr_manager",1,0,0,0
"access_hr_analytic_timesheet_manager","hr.analytic.timesheet.manager","model_hr_analytic_timesheet","base.group_hr_manager",1,1,1,1
"access_hr_analytic_timesheet_system","hr.analytic.timesheet.system","model_hr_analytic_timesheet","base.group_system",1,0,0,0
"access_hr_account_analytic_line_manager","account.account.analytic.line.manager","account.model_account_analytic_line","base.group_hr_manager",1,1,1,1
"access_account_analytic_journal_manager","account.account.analytic.journal.manager","account.model_account_analytic_journal","base.group_hr_manager",1,1,1,1
"access_product_product_manager","product.product.manager","product.model_product_product","base.group_hr_manager",1,1,1,1
"access_product_template_hr_timesheet_manager","product.template.hr.timesheet.manager","product.model_product_template","base.group_hr_manager",1,1,1,1
"access_product_uom_hr_timesheet_manager","product.uom.hr.timesheet.manager","product.model_product_uom","base.group_hr_manager",1,1,1,1
"access_hr_analytic_timesheet_employee","hr.analytic.timesheet.employee","model_hr_analytic_timesheet","base.group_user",1,1,1,0
"access_account_analytic_line_user","account.account.analytic.line.user","account.model_account_analytic_line","base.group_user",1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
5 access_product_product_user product.product user product.model_product_product base.group_hr_user 1 0 0 0
6 access_product_template_hr_timesheet product.template.hr.timesheet product.model_product_template base.group_hr_user 1 0 0 0
7 access_product_uom_hr_timesheet product.uom.hr.timesheet product.model_product_uom base.group_hr_user 1 0 0 0
8 access_hr_analytic_timesheet_manager hr.analytic.timesheet.manager model_hr_analytic_timesheet base.group_hr_manager 1 0 1 0 1 0 1
9 access_hr_analytic_timesheet_system hr.analytic.timesheet.system model_hr_analytic_timesheet base.group_system 1 0 0 0
10 access_hr_account_analytic_line_manager account.account.analytic.line.manager account.model_account_analytic_line base.group_hr_manager 1 1 1 1
11 access_account_analytic_journal_manager account.account.analytic.journal.manager account.model_account_analytic_journal base.group_hr_manager 1 1 1 1
12 access_product_product_manager product.product.manager product.model_product_product base.group_hr_manager 1 1 1 1
13 access_product_template_hr_timesheet_manager product.template.hr.timesheet.manager product.model_product_template base.group_hr_manager 1 1 1 1
14 access_product_uom_hr_timesheet_manager product.uom.hr.timesheet.manager product.model_product_uom base.group_hr_manager 1 1 1 1
15 access_hr_analytic_timesheet_employee hr.analytic.timesheet.employee model_hr_analytic_timesheet base.group_user 1 1 1 0
16 access_account_analytic_line_user account.account.analytic.line.user account.model_account_analytic_line base.group_user 1 0 0 0

View File

@ -65,7 +65,7 @@
<field name="name">board.hr.timesheet.uninvoiced.form</field>
<field name="model">board.board</field>
<field name="type">form</field>
<field name="inherit_id" ref="hr.board_hr_form"/>
<field name="inherit_id" ref="hr.board_hr_manager_form"/>
<field name="arch" type="xml">
<xpath expr="/form/hpaned/child1" position="inside">
<action colspan="4" height="220" name="%(action_timesheet_uninvoiced_line)d" string="Uninvoice lines with billing rate" />

View File

@ -82,7 +82,7 @@ class account_analytic_line(osv.osv):
_inherit = 'account.analytic.line'
_columns = {
'invoice_id': fields.many2one('account.invoice', 'Invoice', ondelete="set null"),
'to_invoice': fields.many2one('hr_timesheet_invoice.factor', 'Type of Invoicing'),
'to_invoice': fields.many2one('hr_timesheet_invoice.factor', 'Type of Invoicing', help="It allows to set the discount while making invoice"),
}
def unlink(self, cursor, user, ids, context=None):

View File

@ -21,6 +21,17 @@
</field>
</record>
<!--record id="view_account_analytic_account_form" model="ir.ui.view">
<field name="name">account.analytic.account.form</field>
<field name="model">account.analytic.account</field>
<field name="inherit_id" ref="account.view_account_analytic_account_form"/>
<field name="type">form</field>
<field name="arch" type="xml">
<field name="company_currency_id" position="replace">
<field name="currency_id"/>
</field>
</field>
</record-->
<record id="hr_timesheet_line_form" model="ir.ui.view">
<field name="name">hr.analytic.timesheet.form</field>
<field name="model">hr.analytic.timesheet</field>

View File

@ -60,7 +60,7 @@
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
help="Timesheet lines during last 7 days"/>
<separator orientation="vertical"/>
<field name="user_id" widget="selection">
<field name="user_id" widget="selection">
<filter icon="terp-personal"
string="Non Assigned timesheets to users"
help="Non Assigned timesheets to users"
@ -69,7 +69,13 @@
<field name="account_id"/>
<field name="product_id"/>
</group>
<group expand="0" string="Group By...">
<newline/>
<group expand="0" string="Extended Filters..." colspan="10" col="12">
<field name="date"/>
<separator orientation="vertical"/>
<field name="invoice_id" widget="selection"/>
</group>
<group expand="1" string="Group By...">
<filter string="User" name="User" icon="terp-personal" context="{'group_by':'user_id'}"/>
<separator orientation="vertical"/>
<filter string="Account" icon="terp-folder-orange" context="{'group_by':'account_id'}"/>
@ -80,12 +86,6 @@
<filter string="Month" icon="terp-go-month" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-go-year" context="{'group_by':'name'}"/>
</group>
<newline/>
<group expand="0" string="Extended Filters..." colspan="10" col="12">
<field name="date"/>
<separator orientation="vertical"/>
<field name="invoice_id" widget="selection"/>
</group>
</search>
</field>
</record>

View File

@ -14,3 +14,7 @@
"access_report_timesheet_line","report.timesheet.line","model_report_timesheet_line","base.group_hr_manager",1,0,0,0
"access_account_invoice_hr_user","account.invoice.hr.user","account.model_account_invoice","base.group_hr_user",1,1,1,0
"access_account_fiscalyear_hr_user","account.fiscalyear.hr.user","account.model_account_fiscalyear","base.group_hr_user",1,1,1,0
"access_account_invoice_hr_manager","account.invoice.hr.manager","account.model_account_invoice","base.group_hr_manager",1,1,1,1
"access_hr_timesheet_invoice_factor_hr_manager","hr_timesheet_invoice.factor.hr.manager","model_hr_timesheet_invoice_factor","base.group_hr_manager",1,1,1,1
"access_account_invoice_tax_hr_manager","account.invoice.tax.hr.manager","account.model_account_invoice_tax","base.group_hr_manager",1,1,1,1
"access_report_timesheet_line_employee","report.timesheet.line.employee","model_report_timesheet_line","base.group_user",1,1,1,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
14 access_report_timesheet_line report.timesheet.line model_report_timesheet_line base.group_hr_manager 1 0 0 0
15 access_account_invoice_hr_user account.invoice.hr.user account.model_account_invoice base.group_hr_user 1 1 1 0
16 access_account_fiscalyear_hr_user account.fiscalyear.hr.user account.model_account_fiscalyear base.group_hr_user 1 1 1 0
17 access_account_invoice_hr_manager account.invoice.hr.manager account.model_account_invoice base.group_hr_manager 1 1 1 1
18 access_hr_timesheet_invoice_factor_hr_manager hr_timesheet_invoice.factor.hr.manager model_hr_timesheet_invoice_factor base.group_hr_manager 1 1 1 1
19 access_account_invoice_tax_hr_manager account.invoice.tax.hr.manager account.model_account_invoice_tax base.group_hr_manager 1 1 1 1
20 access_report_timesheet_line_employee report.timesheet.line.employee model_report_timesheet_line base.group_user 1 1 1 0

View File

@ -52,7 +52,7 @@
<record id="board_hr_timesheet_form" model="ir.ui.view">
<field name="name">board.hr.timesheet.form</field>
<field name="model">board.board</field>
<field name="inherit_id" ref="hr.board_hr_form"/>
<field name="inherit_id" ref="hr.board_hr_manager_form"/>
<field name="type">form</field>
<field name="arch" type="xml">
<xpath expr="/form/hpaned/child2" position="inside">
@ -77,5 +77,31 @@
</tree>
</field>
</record>
<record id="action_week_attendance_graph" model="ir.actions.act_window">
<field name="name">My Total Attendances By Week</field>
<field name="res_model">hr_timesheet_sheet.sheet</field>
<field name="view_type">form</field>
<field name="view_mode">graph</field>
<field name="domain">[('user_id','=',uid)]</field>
<field name="view_id" ref="hr_timesheet_sheet.view_hr_timesheet_sheet_graph"/>
</record>
<record id="board_hr_week_attendace_form" model="ir.ui.view">
<field name="name">board.hr.timesheet.sheet.form</field>
<field name="model">board.board</field>
<field name="inherit_id" ref="hr.board_hr_form"/>
<field name="type">form</field>
<field name="arch" type="xml">
<xpath expr="/form/hpaned/child2" position="inside">
<action colspan="4" height="220" name="%(action_week_attendance_graph)d" string="My Total Attendance By Week" />
</xpath>
</field>
</record>
<menuitem
action="hr.open_board_hr_manager"
icon="terp-graph"
id="base.menu_hr_manager"
parent="base.menu_hr_dasboard"
groups = "base.group_hr_manager"
sequence="5"/>
</data>
</openerp>

View File

@ -148,10 +148,10 @@
</notebook>
<field name="state"/>
<group col="4" colspan="2">
<button name="button_confirm" states="draft" string="Confirm" type="object" icon="terp-camera_test"/>
<button name="button_confirm" states="draft" string="Confirm" type="object" icon="terp-check"/>
<button name="action_set_to_draft" states="done" string="Set to Draft" type="object" icon="terp-stock_effects-object-colorize"/>
<button name="cancel" states="confirm" string="Refuse" type="workflow" icon="gtk-cancel"/>
<button name="done" states="confirm" string="Approve" type="workflow" icon="gtk-jump-to"/>
<button name="done" states="confirm" string="Approve" type="workflow" icon="terp-camera_test"/>
</group>
</form>
</field>
@ -313,7 +313,17 @@
</tree>
</field>
</record>
<record id="view_hr_timesheet_sheet_graph" model="ir.ui.view">
<field name="name">hr.timesheet.sheet.sheet.graph</field>
<field name="model">hr_timesheet_sheet.sheet</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph orientation="horizontal" string="Available Attendance" type="bar">
<field name="name"/>
<field name="total_attendance" operator="+"/>
</graph>
</field>
</record>
<!-- Timesheet Button on Employee Form -->
<act_window domain="[('user_id', '=', user_id)]" id="act_hr_employee_2_hr_timesheet" name="Timesheets" res_model="hr_timesheet_sheet.sheet" src_model="hr.employee"/>

View File

@ -28,6 +28,7 @@ class hr_timesheet_report(osv.osv):
_auto = False
_columns = {
'year': fields.char('Year',size=64,required=False, readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
@ -50,6 +51,7 @@ class hr_timesheet_report(osv.osv):
select
min(t.id) as id,
l.date as date,
to_char(l.date, 'YYYY-MM-DD') as day,
to_char(l.date,'YYYY') as year,
to_char(l.date,'MM') as month,
sum(l.amount) as cost,

View File

@ -21,7 +21,7 @@
<field name="year" invisible="1"/>
<field name="month" invisible="1"/>
<field name="date" invisible="1"/>
<field name="day" invisible="1"/>
<field name="user_id" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="journal_id" invisible="1"/>
@ -41,37 +41,23 @@
<field name="arch" type="xml">
<search string="Timesheet">
<group col="10" colspan="12">
<filter icon="terp-go-year" string="This Year"
<filter icon="terp-go-year" string=" Year "
name="year"
domain="[('year','=', time.strftime('%%Y'))]"
help="Timesheet in this year"/>
<filter icon="terp-go-month" string="This Month"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;=',time.strftime('%%Y-01-01'))]"
help="Timesheet in current year"/>
<filter icon="terp-go-month" string=" Month "
name="month"
domain="[('month','=', time.strftime('%%m'))]"
help="Timesheet in this month"/>
<filter icon="terp-go-week"
string="Today"
domain="[('date','=', time.strftime('%%Y-%%m-%%d'))]"
help="Timesheet dof the day"/>
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;=',time.strftime('%%Y-%%m-01'))]"
help="Timesheet in current month"/>
<filter icon="terp-go-month"
string=" Month-1 "
domain="[('date','&lt;=', (datetime.date (int(time.strftime('%%Y')), datetime.date.today().month, 1) - datetime.timedelta (days = 1)).strftime('%%Y-%%m-%%d')),('date','&gt;',(datetime.date (int(time.strftime('%%Y')), datetime.date.today().month-1, 1)).strftime('%%Y-%%m-%%d'))]"
help="Timesheet of last month"/>
<separator orientation="vertical"/>
<field name="account_id"/>
<field name="user_id" />
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="User" name="group_user_id" icon="terp-personal" context="{'group_by':'user_id'}"/>
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
<separator orientation="vertical"/>
<filter string="Analytic Account" icon="terp-folder-green" context="{'group_by':'account_id'}"/>
<filter string="General Account" icon="terp-folder-orange" context="{'group_by':'general_account_id'}"/>
<separator orientation="vertical"/>
<filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<separator orientation="vertical"/>
<filter string="Day" icon="terp-go-today" context="{'group_by':'date'}"/>
<filter string="Month" icon="terp-go-month" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
</group>
<newline/>
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="general_account_id"/>
<field name="product_id"/>
@ -81,6 +67,20 @@
<newline/>
<field name="date" />
</group>
<newline/>
<group expand="1" string="Group By...">
<filter string="User" name="group_user_id" icon="terp-personal" context="{'group_by':'user_id'}"/>
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
<separator orientation="vertical"/>
<filter string="Analytic Account" icon="terp-folder-green" context="{'group_by':'account_id'}"/>
<filter string="General Account" icon="terp-folder-orange" context="{'group_by':'general_account_id'}"/>
<filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<separator orientation="vertical"/>
<filter string="Day" icon="terp-go-today" context="{'group_by':'day'}" help="Group by day of date"/>
<filter string="Month" icon="terp-go-month" context="{'group_by':'month'}" help="Group by month of date"/>
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}" help="Group by year of date"/>
</group>
</search>
</field>
</record>

View File

@ -49,18 +49,17 @@
<field name="arch" type="xml">
<search string="Timesheet">
<group col="10" colspan="12">
<filter icon="terp-go-week"
string=" 7 Days "
separator="1"
domain="[('date_current','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date_current','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
help="Timesheet during last 7 days"/>
<filter icon="terp-go-month" string="This Month"
<filter icon="terp-go-year" string=" Year "
domain="[('date_current','&lt;=', time.strftime('%%Y-%%m-%%d')),('date_current','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
help="Timesheet in current year"/>
<filter icon="terp-go-month" string=" Month "
name="month"
domain="[('date_current','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date_current','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
help="Timesheet in this month"/>
<filter icon="terp-go-year" string="This Year"
domain="[('date_current','&lt;=', time.strftime('%%Y-%%m-%%d')),('date_current','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
help="Timesheet in this year"/>
help="Timesheet in current month"/>
<filter icon="terp-go-month"
string=" Month-1 "
domain="[('date_current','&lt;=', (datetime.date (int(time.strftime('%%Y')), datetime.date.today().month, 1) - datetime.timedelta (days = 1)).strftime('%%Y-%%m-%%d')),('date_current','&gt;',(datetime.date (int(time.strftime('%%Y')), datetime.date.today().month-1, 1)).strftime('%%Y-%%m-%%d'))]"
help="Timesheet of last month"/>
<separator orientation="vertical"/>
<filter icon="terp-document-new"
string="Draft"
@ -76,7 +75,21 @@
<field name="user_id" />
</group>
<newline/>
<group expand="0" string="Group By...">
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="general_account_id"/>
<field name="to_invoice" widget="selection"/>
<separator orientation="vertical"/>
<field name="product_id"/>
<separator orientation="vertical"/>
<field name="department_id" widget="selection"/>
<separator orientation="vertical"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<newline/>
<field name="date_to"/>
<field name="date_from"/>
</group>
<newline/>
<group expand="1" string="Group By...">
<filter string="User" name="User_id" icon="terp-personal" context="{'group_by':'user_id'}"/>
<filter string="Department" icon="terp-personal+" context="{'group_by':'department_id'}"/>
<separator orientation="vertical"/>
@ -91,23 +104,9 @@
<separator orientation="vertical"/>
<filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<separator orientation="vertical"/>
<filter string="Day" icon="terp-go-today" context="{'group_by':'day'}"/>
<filter string="Month" icon="terp-go-month" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
</group>
<newline/>
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="general_account_id"/>
<field name="to_invoice" widget="selection"/>
<separator orientation="vertical"/>
<field name="product_id"/>
<separator orientation="vertical"/>
<field name="department_id" widget="selection"/>
<separator orientation="vertical"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<newline/>
<field name="date_to"/>
<field name="date_from"/>
<filter string="Day" icon="terp-go-today" context="{'group_by':'day'}" help="Group by day of date"/>
<filter string="Month" icon="terp-go-month" context="{'group_by':'month'}" help="Group by month of date"/>
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}" help="Group by year of date"/>
</group>
</search>
</field>

View File

@ -5,7 +5,7 @@
"access_hr_timesheet_report","hr.timesheet.report","model_hr_timesheet_report","base.group_hr_manager",1,1,1,1
"access_hr_timesheet_sheet_sheet_manager","hr_timesheet_sheet.sheet.manager","model_hr_timesheet_sheet_sheet","base.group_hr_manager",1,1,1,1
"access_hr_timesheet_sheet_sheet_system","hr_timesheet_sheet.sheet.system","model_hr_timesheet_sheet_sheet","base.group_system",1,0,0,0
"access_timesheet_report_manager","timesheet.report.manager","model_timesheet_report","base.group_hr_manager",1,1,1,1
"access_timesheet_report_employee","timesheet.report.employee","model_timesheet_report","base.group_user",1,1,1,0
"access_hr_timesheet_sheet_sheet_employee","hr_timesheet_sheet.sheet.employee","model_hr_timesheet_sheet_sheet","base.group_user",1,1,1,0
"access_hr_timesheet_sheet_sheet_day_manager","hr_timesheet_sheet.sheet.day.manager","model_hr_timesheet_sheet_sheet_day","base.group_hr_manager",1,1,1,1
"access_hr_timesheet_sheet_sheet_account_manager","hr_timesheet_sheet.sheet.account.manager","model_hr_timesheet_sheet_sheet_account","base.group_hr_manager",1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
5 access_hr_timesheet_report hr.timesheet.report model_hr_timesheet_report base.group_hr_manager 1 1 1 1
6 access_hr_timesheet_sheet_sheet_manager hr_timesheet_sheet.sheet.manager model_hr_timesheet_sheet_sheet base.group_hr_manager 1 1 1 1
7 access_hr_timesheet_sheet_sheet_system hr_timesheet_sheet.sheet.system model_hr_timesheet_sheet_sheet base.group_system 1 0 0 0
8 access_timesheet_report_manager access_timesheet_report_employee timesheet.report.manager timesheet.report.employee model_timesheet_report base.group_hr_manager base.group_user 1 1 1 1 0
9 access_hr_timesheet_sheet_sheet_employee hr_timesheet_sheet.sheet.employee model_hr_timesheet_sheet_sheet base.group_user 1 1 1 0
10 access_hr_timesheet_sheet_sheet_day_manager hr_timesheet_sheet.sheet.day.manager model_hr_timesheet_sheet_sheet_day base.group_hr_manager 1 1 1 1
11 access_hr_timesheet_sheet_sheet_account_manager hr_timesheet_sheet.sheet.account.manager model_hr_timesheet_sheet_sheet_account base.group_hr_manager 1 1 1 1

View File

@ -31,15 +31,15 @@
<group>
<filter icon="terp-go-year" string=" Year "
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;=',time.strftime('%%Y-01-01'))]"
help="Idea Vote created last 365 days"/>
help="Idea Vote created in curren year"/>
<filter icon="terp-go-month" string=" Month "
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;=',time.strftime('%%Y-%%m-01'))]"
help="Idea Vote created in last 30 days"/>
help="Idea Vote created in current month"/>
<filter icon="terp-go-month"
string=" Month-1 "
separator="1"
domain="[('date','&lt;=', (datetime.date (int(time.strftime('%%Y')), datetime.date.today().month, 1) - datetime.timedelta (days = 1)).strftime('%%Y-%%m-%%d')),('date','&gt;',(datetime.date (int(time.strftime('%%Y')), datetime.date.today().month-1, 1)).strftime('%%Y-%%m-%%d'))]"
help="Idea Vote created last 7 days"/>
help="Idea Vote created last month"/>
<separator orientation="vertical"/>
<filter icon="terp-go-today"
string=" Today "
@ -60,12 +60,12 @@
domain="[('idea_state','=',('cancel'))]"/>
<separator orientation="vertical"/>
<field name="idea_id" string="Idea"/>
<field name="creater_id" string="creater"/>
<field name="creater_id" string="creator"/>
<field name="user_id"/>
</group>
<newline/>
<group expand="0" string="Group By..." colspan="10" col="12">
<filter string="creater" icon="terp-personal" context="{'group_by':'creater_id'}"/>
<filter string="creator" icon="terp-personal" context="{'group_by':'creater_id'}"/>
<filter string="User" icon="terp-personal" name="User" context="{'group_by':'user_id'}"/>
<separator orientation="vertical"/>
<filter string="Idea" icon="terp-idea" context="{'group_by':'idea_id'}"/>

View File

@ -1,23 +1,23 @@
- |
In order to test the Lunch module in OpenERP,
In order to test the Lunch module in OpenERP,
I will create one lunch order and then check the effect on cashboxes and cashmoves
- |
Given that I have a category of lunch products "Burger".
-
-
!record {model: lunch.category, id: lunch_category_burger0}:
name: Burger
- |
Given that I have a product "Club1" in this category with a price of "2.75".
-
-
!record {model: lunch.product, id: lunch_product_club1}:
category_id: lunch_category_burger0
name: Club1
price: 2.75
price: 2.75
- |
Given that I have a cashbox "Employee Cashbox"
-
-
!record {model: lunch.cashbox, id: lunch_cashbox_cashbox0}:
manager: base.user_root
name: Employee Cashbox
@ -25,87 +25,87 @@
I create a lunch order "LU001" for the "Club1" product
- |
When I select the product "club1", the price of 2.75 is automatically proposed
-
-
!record {model: lunch.order, id: lunch_order_0}:
date: '2010-04-19'
product: 'lunch_product_club1'
price: 2.75
user_id: base.user_root
- |
I check that lunch order is on draft state after having created it.
-
!assert {model: lunch.order, id: lunch_order_0}:
- state == 'draft'
- state == 'draft'
- |
I confirm the order "LU001" using the "Confirm Order" wizard.
-
-
!record {model: lunch.order.confirm, id: lunch_order_confirm_0}:
confirm_cashbox: 'lunch_cashbox_cashbox0'
-
I click on "Confirm Order" button of this wizard.
I click on "Confirm Order" button of this wizard.
-
!python {model: lunch.order.confirm}: |
self.confirm(cr, uid, [ref('lunch_order_confirm_0')], {'active_ids': [ref('lunch_order_0')]})
self.confirm(cr, uid, [ref('lunch_order_confirm_0')], {'active_ids': [ref('lunch_order_0')]})
- |
I check that the Cash Moves have been generated with the right box
name
-
!assert {model: lunch.order, id: lunch_order_0}:
!assert {model: lunch.order, id: lunch_order_0}:
- cashmove.id != False
- |
I check that the Total on the "Employee Cashbox" is -2.75
-
!assert {model: lunch.cashbox, id: lunch_cashbox_cashbox0}:
- sum_remain == -2.75
- |
I create a new lunch order "LU002" for the "Club1" product, at another date.
-
-
!record {model: lunch.order, id: lunch_order_1}:
date: '2010-04-22'
product: 'lunch_product_club1'
price: 2.75
user_id: base.user_root
- |
I confirm this order.open wizard and select "Employee Cashbox".
-
-
!record {model: lunch.order.confirm, id: lunch_order_confirm_1}:
confirm_cashbox: 'lunch_cashbox_cashbox0'
- |
Now I click on "Confirm Order" button of this wizard.
Now I click on "Confirm Order" button of this wizard.
-
!python {model: lunch.order.confirm}: |
self.confirm(cr, uid, [ref('lunch_order_confirm_1')], {'active_ids': [ref('lunch_order_1')]})
- |
I check that the Total on the "Employee Cashbox" is -5.50
-
!assert {model: lunch.cashbox, id: lunch_cashbox_cashbox0}:
- sum_remain == -5.50
- sum_remain == -5.50
- |
I cancel the order "LU002"
-
-
!record {model: lunch.order.cancel, id: lunch_order_cancel_0}:
{}
- |
I click on "Yes" button of this wizard for cancel order.
I click on "Yes" button of this wizard for cancel order.
-
!python {model: lunch.order.cancel}: |
self.cancel(cr, uid, [ref('lunch_order_cancel_0')], {'active_ids': [ref('lunch_order_1')]})
- |
I test that the Cash Moves record have been removed for the order LU002.
-
!assert {model: lunch.order, id: lunch_order_1}:
!assert {model: lunch.order, id: lunch_order_1}:
- cashmove.id == False
- |
I check that the Total on the "Employee Cashbox" is -2.75
-
@ -113,7 +113,7 @@
- sum_remain == -2.75
- |
I reset the "Employee Cashbox" to zero using the "Set CashBox to Zero" wizard.
-
-
!record {model: lunch.cashbox.clean, id: lunch_cashbox_clean_0}:
{}
-
@ -121,10 +121,10 @@
-
!python {model: lunch.cashbox.clean, id: lunch_cashbox_clean_0}: |
self.set_to_zero(cr, uid, [ref('lunch_cashbox_clean_0')], {'active_ids': [ref('lunch_cashbox_cashbox0')]})
- |
I check that the Total on the "Employee Cashbox" is 0.0
I check that the Total on the "Employee Cashbox" is -5.50
-
!assert {model: lunch.cashbox, id: lunch_cashbox_cashbox0}:
- sum_remain == 0.00

View File

@ -40,3 +40,4 @@
"access_product_ul_system","product.ul system","model_product_ul","base.group_system",1,1,1,1
"access_product_product_system","product.product system","model_product_product","base.group_system",1,0,0,0
"access_product_category_system","product.category.system","model_product_category","base.group_system",1,1,1,1
"access_product_product_employee","product.product employee","model_product_product","base.group_user",1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
40 access_product_ul_system product.ul system model_product_ul base.group_system 1 1 1 1
41 access_product_product_system product.product system model_product_product base.group_system 1 0 0 0
42 access_product_category_system product.category.system model_product_category base.group_system 1 1 1 1
43 access_product_product_employee product.product employee model_product_product base.group_user 1 0 0 0

View File

@ -32,7 +32,7 @@
'website': 'http://www.openerp.com',
'depends': ['base', 'project', 'hr_timesheet_sheet'],
'init_xml': [],
'update_xml': ["process/project_timesheet_process.xml", "report/task_report_view.xml"],
'update_xml': ["security/ir.model.access.csv","process/project_timesheet_process.xml", "report/task_report_view.xml"],
'demo_xml': [],
'test': [
'test/worktask_entry_to_timesheetline_entry.yml',

View File

@ -46,15 +46,15 @@
</field>
</record>
<record id="action_report_timesheet_task_user" model="ir.actions.act_window">
<field name="name">Timesheet / Task Hours Per Month</field>
<field name="name">Task Hours Per Month</field>
<field name="res_model">report.timesheet.task.user</field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
<field name="context">{"search_default_user_id":uid}</field>
<field name="search_view_id" ref="view_report_timesheet_task_user_search"/>
</record>
<menuitem id="menu_timesheet_task_user" parent="hr.menu_hr_reporting"
action="action_report_timesheet_task_user" sequence="4"/>
<menuitem id="menu_timesheet_task_user" parent="hr_timesheet.menu_hr_reporting_timesheet"
action="action_report_timesheet_task_user" sequence="1"/>
</data>
</openerp>

View File

@ -1,6 +1,6 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_report_timesheet_task_user","report.timesheet.task.user","model_report_timesheet_task_user","project.group_project_manager",1,0,0,0
"access_hr_analytic_timesheet_user","hr.analytic.timesheet.user","model_hr_analytic_timesheet","project.group_project_user",1,1,1,0
"access_hr_timesheet_sheet_sheet_user","hr.timesheet.sheet.sheet.user","model_hr_timesheet_sheet.sheet","project.group_project_user",1,1,1,0
"access_hr_analytic_timesheet_system","hr.analytic.timesheet system","model_hr_analytic_timesheet","base.group_system",1,1,1,1
"access_hr_timesheet_sheet_sheet_system","hr.timesheet.sheet.sheet system","model_hr_timesheet_sheet.sheet","base.group_system",1,1,1,1
"access_report_timesheet_task_user_manager","report.timesheet.task.user.manager","model_report_timesheet_task_user","project.group_project_manager",1,1,1,1
"access_hr_analytic_timesheet_user","hr.analytic.timesheet.user","hr_timesheet_sheet.model_hr_analytic_timesheet","project.group_project_user",1,1,1,0
"access_hr_timesheet_sheet_sheet_user","hr.timesheet.sheet.sheet.user","hr_timesheet_sheet.model_hr_timesheet_sheet_sheet","project.group_project_user",1,1,1,0
"access_hr_analytic_timesheet_system","hr.analytic.timesheet.system","hr_timesheet_sheet.model_hr_analytic_timesheet","base.group_system",1,1,1,1
"access_hr_timesheet_sheet_sheet_system","hr.timesheet.sheet.sheet.system","hr_timesheet_sheet.model_hr_timesheet_sheet_sheet","base.group_system",1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_report_timesheet_task_user access_report_timesheet_task_user_manager report.timesheet.task.user report.timesheet.task.user.manager model_report_timesheet_task_user project.group_project_manager 1 0 1 0 1 0 1
3 access_hr_analytic_timesheet_user hr.analytic.timesheet.user model_hr_analytic_timesheet hr_timesheet_sheet.model_hr_analytic_timesheet project.group_project_user 1 1 1 0
4 access_hr_timesheet_sheet_sheet_user hr.timesheet.sheet.sheet.user model_hr_timesheet_sheet.sheet hr_timesheet_sheet.model_hr_timesheet_sheet_sheet project.group_project_user 1 1 1 0
5 access_hr_analytic_timesheet_system hr.analytic.timesheet system hr.analytic.timesheet.system model_hr_analytic_timesheet hr_timesheet_sheet.model_hr_analytic_timesheet base.group_system 1 1 1 1
6 access_hr_timesheet_sheet_sheet_system hr.timesheet.sheet.sheet system hr.timesheet.sheet.sheet.system model_hr_timesheet_sheet.sheet hr_timesheet_sheet.model_hr_timesheet_sheet_sheet base.group_system 1 1 1 1

View File

@ -53,7 +53,7 @@ class subscription_document_fields(osv.osv):
_rec_name = 'field'
_columns = {
'field': fields.many2one('ir.model.fields', 'Field', domain="[('model_id', '=', parent.model)]", required=True),
'value': fields.selection([('false','False'),('date','Current Date')], 'Default Value', size=40, help="User can set new values for the field when new document is generated"),
'value': fields.selection([('false','False'),('date','Current Date')], 'Default Value', size=40, help="Default value is considered for field when new document is generated."),
'document_id': fields.many2one('subscription.document', 'Subscription Document', ondelete='cascade'),
}
_defaults = {}
@ -79,7 +79,7 @@ class subscription_subscription(osv.osv):
'state': fields.selection([('draft','Draft'),('running','Running'),('done','Done')], 'State'),
'doc_source': fields.reference('Source Document', required=True, selection=_get_document_types, size=128, help="User can choose the source document on which he wants to create documents"),
'doc_lines': fields.one2many('subscription.subscription.history', 'subscription_id', 'Documents created', readonly=True),
'cron_id': fields.many2one('ir.cron', 'Cron Job', help="Scheduler which run on subscription"),
'cron_id': fields.many2one('ir.cron', 'Cron Job', help="Scheduler which runs on subscription"),
'note': fields.text('Notes', help="Description or Summary of Subscription"),
}
_defaults = {