[MOD] hr_* : applied changes from usability branch

bzr revid: vir@tinyerp.com-20101008132247-3m1ff2ngm3im61pn
This commit is contained in:
Vir (Open ERP) 2010-10-08 18:52:47 +05:30
parent 30efb09f7a
commit a141d983d9
56 changed files with 297 additions and 310 deletions

View File

@ -26,10 +26,28 @@ import tools
from tools.translate import _
class hr_employee_category(osv.osv):
def name_get(self, cr, uid, ids, context=None):
if not len(ids):
return []
reads = self.read(cr, uid, ids, ['name','parent_id'], context)
res = []
for record in reads:
name = record['name']
if record['parent_id']:
name = record['parent_id'][1]+' / '+name
res.append((record['id'], name))
return res
def _name_get_fnc(self, cr, uid, ids, prop, unknow_none, context):
res = self.name_get(cr, uid, ids, context)
return dict(res)
_name = "hr.employee.category"
_description = "Employee Category"
_columns = {
'name': fields.char("Category", size=64, required=True),
'complete_name': fields.function(_name_get_fnc, method=True, type="char", string='Name'),
'parent_id': fields.many2one('hr.employee.category', 'Parent Category', select=True),
'child_ids': fields.one2many('hr.employee.category', 'parent_id', 'Child Categories')
}
@ -117,7 +135,7 @@ class hr_employee(osv.osv):
'address_id': fields.many2one('res.partner.address', 'Working Address'),
'address_home_id': fields.many2one('res.partner.address', 'Home Address'),
'partner_id': fields.related('address_home_id', 'partner_id', type='many2one', relation='res.partner', readonly=True, help="Partner that is related to the current employee. Accounting transaction will be written on this partner belongs to employee."),
'work_phone': fields.related('address_id', 'phone', type='char', string='Work Phone', readonly=True),
'work_phone': fields.related('address_id', 'phone', type='char', size=32, string='Work Phone', 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'),
@ -135,21 +153,25 @@ class hr_employee(osv.osv):
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':{}}
return {'value':{'address_id':False}}
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}}
if not department_id:
return {'value':{'parent_id': False}}
manager = self.pool.get('hr.department').browse(cr, uid, department_id).manager_id
return {'value': {'parent_id':manager and manager.id or False}}
def onchange_user(self, cr, uid, ids, user_id, context=None):
if not user_id:
return {'value':{'work_email': False}}
mail = self.pool.get('res.users').browse(cr,uid,user_id)
return {'value': {'work_email':mail.user_email}}
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,

View File

@ -67,7 +67,7 @@
<field name="help">Your Company's Departments Structure is used to manage all documents related to employees by departments: expenses and timesheet validation, leaves management, recruitements, etc.</field>
</record>
<menuitem action="open_module_tree_department" id="menu_hr_department_tree" parent="hr.menu_hr_management" sequence="6"/>
<menuitem action="open_module_tree_department" id="menu_hr_department_tree" parent="hr.menu_hr_management" sequence="6" />
<record model="ir.ui.view" id="view_users_form_inherit">
<field name="name">res.users.form</field>

View File

@ -3,10 +3,10 @@
<data>
<menuitem id="menu_hr_root" icon="terp-hr" name="Human Resources" sequence="15"/>
<menuitem id="menu_hr_main" parent="menu_hr_root" name="Human Resources" sequence="0"/>
<menuitem id="menu_hr_configuration" name="Configuration" parent="hr.menu_hr_root" sequence="50"/>
<menuitem id="menu_hr_main" parent="menu_hr_root" name="Human Resources" sequence="0" groups="base.group_hr_manager,base.group_hr_user"/>
<menuitem id="menu_hr_configuration" name="Configuration" parent="hr.menu_hr_root" groups="base.group_hr_manager" sequence="50"/>
<menuitem id="menu_hr_management" name="Human Resources" parent="hr.menu_hr_configuration" sequence="1"/>
<menuitem id="menu_view_employee_category_configuration_form" parent="hr.menu_hr_management" groups="base.group_system" name="Employees" sequence="1" />
<menuitem id="menu_view_employee_category_configuration_form" parent="hr.menu_hr_management" groups="base.group_hr_manager" name="Employees" sequence="1" />
<!--
==========
@ -100,7 +100,7 @@
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Employees">
<filter icon="terp-personal+" domain="[('active','=',True)]" string="Active" groups="base.group_extended"/>
<filter icon="terp-personal+" domain="[('active','=',True)]" name="active" string="Active" groups="base.group_extended"/>
<separator orientation="vertical" />
<field name="name"/>
<field name="department_id" widget="selection">
@ -146,12 +146,13 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[]</field>
<field name="context">{"search_default_department_id": department_id,"search_default_active":eval('True')}</field>
<field name="view_id" ref="view_employee_tree"/>
<field name="search_view_id" ref="view_employee_filter"/>
<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>
<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" groups="base.group_system,base.group_hr_manager,base.group_hr_user"/>
<menuitem action="open_view_employee_list_my" id="menu_open_view_employee_list_my" sequence="3" parent="menu_hr_main" groups="base.group_hr_manager,base.group_hr_user"/>
<!--
=======================
@ -259,8 +260,7 @@
<field eval="8" name="priority"/>
<field name="arch" type="xml">
<tree string="Employees Categories">
<field name="name"/>
<field name="parent_id"/>
<field name="complete_name"/>
</tree>
</field>
</record>
@ -384,6 +384,7 @@
<newline />
<group expand="0" string="Group By...">
<filter string="Department" icon="terp-personal+" domain="[]" context="{'group_by':'department_id'}"/>
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
<filter string="Company" icon="terp-go-home" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
</group>
</search>
@ -396,11 +397,11 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_job_filter"/>
<field name="context">{'search_default_Current':1}</field>
<field name="context">{"search_default_Current":1,"search_default_department_id": department_id}</field>
<field name="help">Job Positions are used to define the jobs, the requirements. You can attach a survey to a job position. This survey will be used in the recruitement process to evaluate the applicants for this job position.</field>
</record>
<menuitem name="Recruitment" id="base.menu_crm_case_job_req_main" parent="menu_hr_root" groups="base.group_hr_manager,base.group_system"/>
<menuitem name="Recruitment" id="base.menu_crm_case_job_req_main" parent="menu_hr_root" groups="base.group_hr_user"/>
<menuitem parent="base.menu_crm_case_job_req_main" id="menu_hr_job" action="action_hr_job" sequence="2"/>
</data>

View File

@ -1,20 +1,9 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_hr_employee_category_user","hr.employee.category.user","model_hr_employee_category","base.group_hr_user",1,0,0,0
"access_hr_employee_category_user","hr.employee.category.user","model_hr_employee_category","base.group_hr_user",1,1,1,1
"access_hr_employee_user","hr.employee user","model_hr_employee","base.group_hr_user",1,1,1,1
"access_hr_employee_system_user","hr.employee system user","model_hr_employee","base.group_user",1,0,0,0
"access_hr_employee_resource_user","resource.resource.user","resource.model_resource_resource","base.group_hr_user",1,1,1,1
"access_hr_department_user","hr.department.user","model_hr_department","base.group_hr_user",1,1,1,1
"access_hr_employee_category_manager","hr.employee.category.manager","model_hr_employee_category","base.group_hr_manager",1,1,1,1
"access_hr_department_manager","hr.department.manager","model_hr_department","base.group_hr_manager",1,1,1,1
"access_hr_employee_marital_status","hr.employee.marital.status","model_hr_employee_marital_status","base.group_system",1,1,1,1
"access_hr_job_user","hr.job user","model_hr_job","base.group_hr_user",1,0,0,0
"access_hr_employee_category_system","hr.employee.category.system","model_hr_employee_category","base.group_system",1,1,1,1
"access_hr_employee_manager","hr.employee.manager","model_hr_employee","base.group_hr_manager",1,1,1,1
"access_hr_employee_resource_manager","resource.resource.manager","resource.model_resource_resource","base.group_hr_manager",1,1,1,1
"access_hr_department_system","hr.department.system","model_hr_department","base.group_system",1,1,1,1
"access_hr_job_user","hr.job user","model_hr_job","base.group_hr_user",1,1,1,1
"access_hr_res_partner_address","res.partner.address","base.model_res_partner_address","base.group_hr_manager",1,1,1,1
"access_hr_job_manager","hr.job.manager","model_hr_job","base.group_hr_manager",1,1,1,1
"access_hr_employee_system","hr.employee.system","model_hr_employee","base.group_system",1,0,0,0
"access_hr_job_system","hr.job system","model_hr_job","base.group_system",1,0,0,0
"access_hr_employee_employee","hr.employee.employee","model_hr_employee","base.group_user",1,0,0,0
"access_hr_employee_category_employee","hr.employee.category.employee","model_hr_employee_category","base.group_user",1,0,0,0
"access_hr_department_employee","hr.department.employee","model_hr_department","base.group_user",1,0,0,0
"access_hr_employee_marital_status_manager","hr.employee.marital.status.manager","model_hr_employee_marital_status","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_employee_category_user hr.employee.category.user model_hr_employee_category base.group_hr_user 1 0 1 0 1 0 1
3 access_hr_employee_user hr.employee user model_hr_employee base.group_hr_user 1 1 1 1
4 access_hr_employee_system_user hr.employee system user model_hr_employee base.group_user 1 0 0 0
5 access_hr_employee_resource_user resource.resource.user resource.model_resource_resource base.group_hr_user 1 1 1 1
6 access_hr_department_user hr.department.user model_hr_department base.group_hr_user 1 1 1 1
7 access_hr_employee_category_manager access_hr_job_user hr.employee.category.manager hr.job user model_hr_employee_category model_hr_job base.group_hr_manager base.group_hr_user 1 1 1 1
access_hr_department_manager hr.department.manager model_hr_department base.group_hr_manager 1 1 1 1
access_hr_employee_marital_status hr.employee.marital.status model_hr_employee_marital_status base.group_system 1 1 1 1
access_hr_job_user hr.job user model_hr_job base.group_hr_user 1 0 0 0
access_hr_employee_category_system hr.employee.category.system model_hr_employee_category base.group_system 1 1 1 1
access_hr_employee_manager hr.employee.manager model_hr_employee base.group_hr_manager 1 1 1 1
access_hr_employee_resource_manager resource.resource.manager resource.model_resource_resource base.group_hr_manager 1 1 1 1
access_hr_department_system hr.department.system model_hr_department base.group_system 1 1 1 1
8 access_hr_res_partner_address res.partner.address base.model_res_partner_address base.group_hr_manager 1 1 1 1
9 access_hr_job_manager access_hr_employee_marital_status_manager hr.job.manager hr.employee.marital.status.manager model_hr_job model_hr_employee_marital_status base.group_hr_manager 1 1 1 1
access_hr_employee_system hr.employee.system model_hr_employee base.group_system 1 0 0 0
access_hr_job_system hr.job system model_hr_job base.group_system 1 0 0 0
access_hr_employee_employee hr.employee.employee model_hr_employee base.group_user 1 0 0 0
access_hr_employee_category_employee hr.employee.category.employee model_hr_employee_category base.group_user 1 0 0 0
access_hr_department_employee hr.department.employee model_hr_department base.group_user 1 0 0 0

View File

@ -150,7 +150,7 @@ class hr_employee(osv.osv):
res = {'action': type, 'employee_id': emp['id']}
if dt:
res['name'] = dt
id = obj_attendance.create(cr, uid, res, context=context)
id = obj_attendance.create(cr, uid, res, context=context)
if type != 'action':
return id

View File

@ -125,13 +125,13 @@
<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')])]"/>
<field name="groups" eval="[(6,0,[ref('base.group_hr_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')])]"/>
<field name="groups" eval="[(6,0,[ref('base.group_hr_manager')])]"/>
</record>
</data>
</openerp>

View File

@ -81,7 +81,7 @@
<menuitem id="menu_hr_attendance" name="Attendances" parent="hr.menu_hr_root" sequence="4"/>
<menuitem action="open_view_attendance" id="menu_open_view_attendance" parent="menu_hr_attendance" groups="base.group_hr_user" sequence="3"/>
<menuitem action="open_view_attendance" id="menu_open_view_attendance" parent="menu_hr_attendance" sequence="3"/>
<record id="edit_attendance_reason" model="ir.ui.view">
<field name="name">hr.action.reason.form</field>
@ -89,8 +89,8 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Define attendance reason">
<field colspan="4" name="name" />
<field name="action_type" />
<field colspan="4" name="name" select="1"/>
<field name="action_type" select="1"/>
</form>
</field>
</record>
@ -101,7 +101,7 @@
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Attendance reasons">
<field name="name"/>
<field name="name" />
<field name="action_type"/>
</tree>
</field>
@ -116,7 +116,7 @@
<field name="view_id" ref="view_attendance_reason"/>
</record>
<menuitem sequence="2" id="hr.menu_open_view_attendance_reason_new_config" parent="hr.menu_hr_configuration" name="Time Tracking" />
<menuitem sequence="2" id="hr.menu_open_view_attendance_reason_new_config" parent="hr.menu_hr_configuration" name="Attendances" />
<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">

View File

@ -2,9 +2,5 @@
<openerp>
<data noupdate="1">
<record id="base.group_hr_attendance" model="res.groups">
<field name="name">Human Resources / Attendances User</field>
</record>
</data>
</openerp>

View File

@ -1,13 +1,4 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_hr_action_reason_attendance","hr.action.reason.attendance","model_hr_action_reason","base.group_hr_attendance",1,0,0,0
"access_hr_action_reason_manager","hr.action.reason.manager","model_hr_action_reason","base.group_hr_manager",1,1,1,1
"access_hr_action_reason_employee_user","hr.action.reason.employee.user","model_hr_attendance","base.group_hr_user",1,1,1,1
"access_hr_attendance_manager","hr.attendance.manager","model_hr_attendance","base.group_hr_manager",1,1,1,1
"access_hr_attendance_attendance","hr.attendance.attendance","model_hr_attendance","base.group_hr_attendance",1,1,1,1
"access_hr_employee_attendance","hr.employee.attendance","hr.model_hr_employee","base.group_hr_attendance",1,0,0,0
"access_resource_resource_attendance","resource.resource.attendance","resource.model_resource_resource","base.group_hr_attendance",1,1,1,1
"access_hr_job_attendance","hr.job.attendance","hr.model_hr_job","base.group_hr_attendance",1,0,0,0
"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
"access_hr_action_reason_user","hr.action.reason.user","model_hr_action_reason","base.group_hr_user",1,1,1,1
"access_hr_attendance_user","hr.attendance.user","model_hr_attendance","base.group_hr_user",1,1,1,1
"access_hr_attendance_system_user","hr.attendance.system.user","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
2 access_hr_action_reason_attendance access_hr_action_reason_user hr.action.reason.attendance hr.action.reason.user model_hr_action_reason base.group_hr_attendance base.group_hr_user 1 0 1 0 1 0 1
3 access_hr_action_reason_manager access_hr_attendance_user hr.action.reason.manager hr.attendance.user model_hr_action_reason model_hr_attendance base.group_hr_manager base.group_hr_user 1 1 1 1
4 access_hr_action_reason_employee_user access_hr_attendance_system_user hr.action.reason.employee.user hr.attendance.system.user model_hr_attendance base.group_hr_user base.group_user 1 1 0 1 0 1 0
access_hr_attendance_manager hr.attendance.manager model_hr_attendance base.group_hr_manager 1 1 1 1
access_hr_attendance_attendance hr.attendance.attendance model_hr_attendance base.group_hr_attendance 1 1 1 1
access_hr_employee_attendance hr.employee.attendance hr.model_hr_employee base.group_hr_attendance 1 0 0 0
access_resource_resource_attendance resource.resource.attendance resource.model_resource_resource base.group_hr_attendance 1 1 1 1
access_hr_job_attendance hr.job.attendance hr.model_hr_job base.group_hr_attendance 1 0 0 0
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

View File

@ -47,7 +47,7 @@
</record>
<menuitem action="action_hr_attendance_sigh_in_out" id="menu_hr_attendance_sigh_in_out"
parent="menu_hr_attendance" sequence="4" groups="base.group_hr_manager,base.group_hr_user,base.group_hr_attendance"/>
parent="menu_hr_attendance" sequence="4"/>
<record id="view_hr_attendance_so_ask" model="ir.ui.view">
<field name="name">hr.sign.in.out.ask.form</field>

View File

@ -57,7 +57,7 @@
<field name="search_view_id" ref="hr_contract_wage_type_view_search"/>
</record>
<menuitem id="next_id_56" name="Contract" parent="hr.menu_hr_management" sequence="5" groups="base.group_system"/>
<menuitem id="next_id_56" name="Contract" parent="hr.menu_hr_management" sequence="5" groups="base.group_hr_manager"/>
<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">
@ -146,6 +146,9 @@
<field name="arch" type="xml">
<search string="Search Contract">
<group col='15' colspan='4'>
<filter string="Current" icon="terp-check" name="current" domain="[('date_end','&gt;=', time.strftime('%%Y-%%m-%%d'))]" context="{'group_by':'date_end'}" help="Contracts in progress"/>
<filter string="Overpassed" icon="terp-emblem-important" domain="[('date_end','&lt;', time.strftime('%%Y-%%m-%%d'))]" context="{'group_by':'date_end'}" help="Contracts whose end date already passed"/>
<separator orientation="vertical"/>
<field name="name"/>
<field name="employee_id"/>
<field name="working_hours"/>
@ -154,11 +157,9 @@
</group>
<newline/>
<group expand="0" string="Group By..." colspan="4" col="20">
<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'}"/>
<filter string="Contract Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'type_id'}"/>
<filter string="Working Schedule" icon="terp-go-week" domain="[]" context="{'group_by':'working_hours'}"/>
<filter string="Job" icon="terp-gtk-select-all" domain="[]" context="{'group_by':'job_id'}"/>
</group>
</search>
</field>
@ -213,7 +214,7 @@
<field name="employee_id"/>
<field name="type_id"/>
<field name="job_id"/>
<field name="department_id"/>
<!--field name="department_id"/-->
<field name="working_hours"/>
<field name="date_start"/>
<field name="date_end"/>
@ -224,11 +225,12 @@
</record>
<record id="action_hr_contract" model="ir.actions.act_window">
<field name="name">Contract</field>
<field name="name">Contracts</field>
<field name="res_model">hr.contract</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[]</field>
<field name="context">{'search_default_current':1}</field>
<field name="search_view_id" ref="hr_contract_view_search"/>
</record>
@ -276,7 +278,7 @@
</record>
<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"/>
<menuitem action="action_hr_contract" id="hr_menu_contract" parent="hr.menu_hr_main" name="Contracts" sequence="4" groups="base.group_hr_manager,base.group_hr_user"/>
<!-- Contracts Button on Employee Form -->
<act_window

View File

@ -2,9 +2,5 @@
<openerp>
<data noupdate="1">
<record id="base.group_hr_contract" model="res.groups">
<field name="name">Human Resources / Contract</field>
</record>
</data>
</openerp>

View File

@ -1,20 +1,7 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_hr_contract_wage_type_period_manager","hr.contract.wage.type.period.manager","model_hr_contract_wage_type_period","base.group_hr_manager",1,1,1,1
"access_hr_contract_wage_type_manager","hr.contract.wage.type.manager","model_hr_contract_wage_type","base.group_hr_manager",1,1,1,1
"access_hr_contract_wage_type_contract","hr.contract.wage.type.contract","model_hr_contract_wage_type","base.group_hr_contract",1,1,1,1
"access_hr_contract_wage_type_period_contract","hr.contract.wage.type.period.contract","model_hr_contract_wage_type_period","base.group_hr_contract",1,1,1,1
"access_hr_contract_contract","hr.contract.contract","model_hr_contract","base.group_hr_contract",1,1,1,1
"access_hr_employee_contract_contract","hr.employee.contract.contract","hr.model_hr_employee","base.group_hr_contract",1,1,1,1
"access_hr_resource_contract","hr.employee.resource.contract","resource.model_resource_resource","base.group_hr_contract",1,1,1,1
"access_hr_resource_calendar_contract","hr.employee.resource.calendar.contract","resource.model_resource_calendar","base.group_hr_contract",1,1,1,1
"access_hr_job_contract","hr.job contract","hr.model_hr_job","base.group_hr_contract",1,1,1,1
"access_hr_contract_type_contract","hr.contract.type.contract","model_hr_contract_type","base.group_hr_contract",1,1,1,1
"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,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,1,1,1
"access_hr_contract_employee","hr.contract.employee","model_hr_contract","base.group_user",1,0,0,0
"access_hr_contract_wage_type_period_user","hr.contract.wage.type.period.user","model_hr_contract_wage_type_period","base.group_hr_user",1,1,1,1
"access_hr_contract_wage_type_user","hr.contract.wage.type.user","model_hr_contract_wage_type","base.group_hr_user",1,1,1,1
"access_hr_contract_user","hr.contract.user","model_hr_contract","base.group_hr_user",1,1,1,1
"access_hr_resource_manager","hr.employee.resource.manager","resource.model_resource_resource","base.group_hr_manager",1,1,1,1
"access_hr_resource_calendar_user","hr.employee.resource.calendar.user","resource.model_resource_calendar","base.group_hr_user",1,1,1,1
"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
2 access_hr_contract_wage_type_period_manager access_hr_contract_wage_type_period_user hr.contract.wage.type.period.manager hr.contract.wage.type.period.user model_hr_contract_wage_type_period base.group_hr_manager base.group_hr_user 1 1 1 1
3 access_hr_contract_wage_type_manager access_hr_contract_wage_type_user hr.contract.wage.type.manager hr.contract.wage.type.user model_hr_contract_wage_type base.group_hr_manager base.group_hr_user 1 1 1 1
4 access_hr_contract_wage_type_contract access_hr_contract_user hr.contract.wage.type.contract hr.contract.user model_hr_contract_wage_type model_hr_contract base.group_hr_contract base.group_hr_user 1 1 1 1
5 access_hr_contract_wage_type_period_contract access_hr_resource_manager hr.contract.wage.type.period.contract hr.employee.resource.manager model_hr_contract_wage_type_period resource.model_resource_resource base.group_hr_contract base.group_hr_manager 1 1 1 1
6 access_hr_contract_contract access_hr_resource_calendar_user hr.contract.contract hr.employee.resource.calendar.user model_hr_contract resource.model_resource_calendar base.group_hr_contract base.group_hr_user 1 1 1 1
access_hr_employee_contract_contract hr.employee.contract.contract hr.model_hr_employee base.group_hr_contract 1 1 1 1
access_hr_resource_contract hr.employee.resource.contract resource.model_resource_resource base.group_hr_contract 1 1 1 1
access_hr_resource_calendar_contract hr.employee.resource.calendar.contract resource.model_resource_calendar base.group_hr_contract 1 1 1 1
access_hr_job_contract hr.job contract hr.model_hr_job base.group_hr_contract 1 1 1 1
access_hr_contract_type_contract hr.contract.type.contract model_hr_contract_type base.group_hr_contract 1 1 1 1
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 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 1 1 1
access_hr_contract_employee hr.contract.employee model_hr_contract base.group_user 1 0 0 0
7 access_hr_contract_type_manager hr.contract.type.manager model_hr_contract_type base.group_hr_manager 1 1 1 1

View File

@ -33,7 +33,7 @@ class hr_evaluation_plan(osv.osv):
'name': fields.char("Evaluation Plan", size=64, required=True),
'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_first': fields.integer('Next Evaluation After'),
'month_next': fields.integer('After the Date of Start'),
'active': fields.boolean('Active')
}
@ -115,12 +115,11 @@ class hr_employee(osv.osv):
return True
def onchange_evaluation_plan_id(self, cr, uid, ids, evaluation_plan_id, evaluation_date, context=None):
evaluation_date = evaluation_date or False
evaluation_plan_obj=self.pool.get('hr_evaluation.plan')
obj_evaluation = self.pool.get('hr_evaluation.evaluation')
if context is None:
context = {}
if evaluation_plan_id:
evaluation_plan_obj=self.pool.get('hr_evaluation.plan')
obj_evaluation = self.pool.get('hr_evaluation.evaluation')
flag = False
evaluation_plan = evaluation_plan_obj.browse(cr, uid, [evaluation_plan_id], context=context)[0]
if not evaluation_date:
@ -192,11 +191,11 @@ class hr_evaluation(osv.osv):
return res
def onchange_employee_id(self, cr, uid, ids, employee_id, context=None):
employee_obj=self.pool.get('hr.employee')
if context is None:
context = {}
evaluation_plan_id=''
evaluation_plan_id=False
if employee_id:
employee_obj=self.pool.get('hr.employee')
for employee in employee_obj.browse(cr, uid, [employee_id], context=context):
if employee and employee.evaluation_plan_id and employee.evaluation_plan_id.id:
evaluation_plan_id=employee.evaluation_plan_id.id
@ -259,6 +258,7 @@ class hr_evaluation(osv.osv):
def button_done(self,cr, uid, ids, context=None):
if context is None:
context = {}
self.write(cr, uid, ids,{'progress': 1 * 100}, context=context)
self.write(cr, uid, ids,{'state':'done', 'date_close': time.strftime('%Y-%m-%d')}, context=context)
return True

View File

@ -1616,13 +1616,13 @@ Once the form had been filled, the employee send it to his supervisor.
<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')])]"/>
<field name="groups" eval="[(6,0,[ref('base.group_hr_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')])]"/>
<field name="groups" eval="[(6,0,[ref('base.group_hr_manager')])]"/>
</record>
</data>

View File

@ -64,7 +64,7 @@
</record>
<menuitem name="Evaluations" parent="hr.menu_hr_root" id="menu_eval_hr" sequence="6"/>
<menuitem name="Periodic Evaluations" parent="hr.menu_hr_configuration" id="menu_eval_hr_config" sequence="4" groups="base.group_system"/>
<menuitem name="Periodic Evaluations" parent="hr.menu_hr_configuration" id="menu_eval_hr_config" sequence="4" groups="base.group_hr_manager"/>
<menuitem parent="menu_eval_hr_config" id="menu_open_view_hr_evaluation_plan_tree"
action="open_view_hr_evaluation_plan_tree"/>
@ -237,7 +237,7 @@
<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'))]" />
<separator orientation="vertical"/>
<filter icon="terp-gnome-cpu-frequency-applet+" string="Overpassed Deadline"
<filter icon="terp-gnome-cpu-frequency-applet+" string="Late"
help="Evaluations that overpassed the deadline" domain="[('date','&lt;=',(datetime.date.today()).strftime('%%Y-%%m-%%d'))]" />
<separator orientation="vertical"/>
<field name="employee_id" />
@ -246,6 +246,7 @@
<newline/>
<group expand='0' string='Group by...'>
<filter string='Employee' icon="terp-personal" domain="[]" context="{'group_by' : 'employee_id'}" />
<separator orientation="vertical"/>
<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"/>

View File

@ -18,11 +18,11 @@
<field name="year" invisible="1"/>
<field name="month" invisible="1"/>
<field name="rating" invisible="1"/>
<field name="state" 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>
</record>
@ -75,13 +75,13 @@
<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'}"/>
<filter string="Appreciation" icon="terp-face-plain" 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"/>
<filter string="Day" icon="terp-go-today" context="{'group_by':'day'}" help="Creation Date"/>
<filter string="Month" icon="terp-go-month" context="{'group_by':'create_date'}" help="Creation Date"/>
<filter string="Year" icon="terp-go-month" context="{'group_by':'year'}" help="Creation Date"/>
</group>
</search>
</field>

View File

@ -1,21 +1,9 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"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,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,1,1,1
"access_hr_evaluation_plan_user","hr_evaluation.plan.user","model_hr_evaluation_plan","base.group_hr_user",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,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
"access_hr_evaluation_plan","hr_evaluation.plan","model_hr_evaluation_plan","base.group_system",1,1,1,1
"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,7 +16,6 @@
"access_survey_tbl_column_heading_hr_manager","survey.tbl.column.heading","survey.model_survey_tbl_column_heading","base.group_hr_manager",1,1,1,1
"access_survey_response_answer_hr_manager","survey.response.answer","survey.model_survey_response_answer","base.group_hr_manager",1,1,1,1
"access_survey_request_hr_manager","survey.request","survey.model_survey_request","base.group_hr_manager",1,1,1,1
"access_survey_hr_user","survey.hr.user","survey.model_survey","base.group_hr_user",1,1,1,0
"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

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 access_hr_evaluation_plan_user hr_evaluation.evaluation.manager hr_evaluation.plan.user model_hr_evaluation_evaluation model_hr_evaluation_plan base.group_hr_manager base.group_hr_user 1 1 1 1
4 access_hr_evaluation_plan_user access_hr_evaluation_plan_phase_user hr_evaluation.plan.user hr_evaluation.plan.phase.user model_hr_evaluation_evaluation model_hr_evaluation_plan_phase base.group_hr_user 1 0 1 0 1 0 1
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 1 1 1
5 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
6 access_hr_evaluation_report hr.evaluation.report model_hr_evaluation_report base.group_hr_manager 1 1 1 1
access_hr_evaluation_plan hr_evaluation.plan model_hr_evaluation_plan base.group_system 1 1 1 1
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
7 access_survey_type_hr_manager survey.type survey.model_survey_type base.group_hr_manager 1 1 1 1
8 access_survey_hr_manager survey.hr.manager survey.model_survey base.group_hr_manager 1 1 1 1
9 access_survey_history_manager survey.history survey.model_survey_history base.group_hr_manager 1 1 1 1
16 access_survey_tbl_column_heading_hr_manager survey.tbl.column.heading survey.model_survey_tbl_column_heading base.group_hr_manager 1 1 1 1
17 access_survey_response_answer_hr_manager survey.response.answer survey.model_survey_response_answer base.group_hr_manager 1 1 1 1
18 access_survey_request_hr_manager survey.request survey.model_survey_request base.group_hr_manager 1 1 1 1
access_survey_hr_user survey.hr.user survey.model_survey base.group_hr_user 1 1 1 0
19 access_survey_answer_hr_user survey.answer.hr.user survey.model_survey_answer base.group_hr_user 1 1 1 0
20 access_survey_response_answer_hr_user survey.response.answer.hr.user survey.model_survey_response_answer base.group_hr_user 1 1 1 0
21 access_survey_type_hr_user survey.type.hr.user survey.model_survey_type base.group_hr_user 1 1 1 0

View File

@ -9,14 +9,14 @@
<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="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">
<xpath expr="/form/hpaned/child1" position="inside">
<action colspan="4" height="220" name="%(action_employee_expense)d" string="All Employee Expenses" />
</xpath>
</field>

View File

@ -97,6 +97,13 @@ class hr_expense_expense(osv.osv):
'currency_id': _get_currency,
'company_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
}
def onchange_employee_id(self, cr, uid, ids, employee_id, context=None):
if not employee_id:
return {'value':{'department_id': False}}
dept = self.pool.get('hr.employee').browse(cr, uid, employee_id).department_id
return {'value': {'department_id':dept and dept.id or False}}
def expense_confirm(self, cr, uid, ids, *args):
self.write(cr, uid, ids, {
'state':'confirm',

View File

@ -108,13 +108,13 @@
<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')])]"/>
<field name="groups" eval="[(6,0,[ref('base.group_hr_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')])]"/>
<field name="groups" eval="[(6,0,[ref('base.group_hr_manager')])]"/>
</record>
</data>
</openerp>

View File

@ -67,7 +67,7 @@
<field name="arch" type="xml">
<form string="Expenses Sheet">
<group colspan="4" col="6">
<field name="employee_id"/>
<field name="employee_id" on_change="onchange_employee_id(employee_id)"/>
<field name="name" select="1"/>
<field name="ref" groups="base.group_extended"/>
<field name="date" select="1"/>
@ -136,18 +136,22 @@
<separator orientation="vertical"/>
<filter icon="terp-camera_test" domain="[('state','=','confirm')]" string="To Approve"
help="Confirmed Expense"/>
<filter icon="terp-check" domain="[('state','=','accepted')]" string="To Pay"
<filter icon="terp-dolar" domain="[('state','=','accepted')]" string="To Pay"
help="Expenses to Invoice"/>
<separator orientation="vertical"/>
<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="employee_id" select='1'/>
<field name="name" select='1'/>
<field name="date" select='1'/>
<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>
<field name="department_id" widget="selection" groups="base.group_extended"/>
<field name="department_id" widget="selection" string="Department" context="{'invisible_department': False}">
<filter icon="terp-personal+" context="{'invisible_department': False}" domain="[('department_id','=',context.get('department_id',False))]" help="My Department"/>
</field>
</group>
<newline />
<group expand="0" string="Group By...">
@ -165,7 +169,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,'search_default_this':1}</field>
<field name="context">{"search_default_user_id":uid,"search_default_department_id": department_id,"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

@ -65,8 +65,8 @@
<separator orientation="vertical"/>
<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"/>
<filter string="Approved" icon="terp-camera_test" domain="[('state','=','accepted')]"
help = "Approved Expenses"/>
<separator orientation="vertical"/>
<filter string="Invoiced" icon="terp-dolar" domain="[('state','=','invoiced')]"
help = "Invoiced Expenses"/>
@ -82,7 +82,7 @@
<separator orientation="vertical"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<newline/>
<field name="date"/>
<field name="date" string="Creation Date"/>
<field name="date_confirm"/>
<field name="date_valid"/>
</group>
@ -99,9 +99,9 @@
<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"/>
<filter string="Day" icon="terp-go-today" context="{'group_by':'day'}" help="Creation Date"/>
<filter string="Month" icon="terp-go-month" context="{'group_by':'month'}" help="Creation Date"/>
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}" help="Creation Date"/>
</group>
</search>
</field>

View File

@ -1,18 +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,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,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
"access_hr_expense_line_user","hr.expense.line.user","model_hr_expense_line","base.group_hr_user",1,1,1,1
"access_hr_expense_report_manager","hr.expense.report.manager","model_hr_expense_report","base.group_hr_manager",1,1,1,1
"access_product_product_hr_expense_user","product.product.hr.expense.user","product.model_product_product","base.group_hr_user",1,1,1,1
"access_product_template_hr_expense_user","product.template.hr.expense.user","product.model_product_template","base.group_hr_user",1,1,1,1
"access_product_uom_hr_expense_user","product.uom.hr.expense.user","product.model_product_uom","base.group_hr_user",1,1,1,1
"access_product_price_type_user","product.price.type.user","product.model_product_price_type","base.group_hr_user",1,1,1,1
"access_account_journal_user","account.journal.user","account.model_account_journal","base.group_hr_user",1,1,1,1
"access_account_invoice_user","account.invoice.user","account.model_account_invoice","base.group_hr_user",1,1,1,1
"access_account_invoice_line_user","account.invoice.line.user","account.model_account_invoice_line","base.group_hr_user",1,1,1,1
"access_account_analytic_journal_user","account.ianalytic.journal.user","account.model_account_analytic_journal","base.group_hr_user",1,1,1,1
"access_account_invoice_tax_user","account.invoice.tax.user","account.model_account_invoice_tax","base.group_hr_user",1,1,1,1
"access_account_period_user","account.period.user","account.model_account_period","base.group_hr_user",1,1,1,1
"access_account_fiscalyear_user","account.fiscalyear.user","account.model_account_fiscalyear","base.group_hr_user",1,1,1,1
"access_account_move_user","account.move.user","account.model_account_move","base.group_hr_user",1,1,1,1
"access_account_move_line_user","account.move.line.user","account.model_account_move_line","base.group_hr_user",1,1,1,1
"access_account_analytic_line_user","account.ianalytic.line.user","account.model_account_analytic_line","base.group_hr_user",1,1,1,1

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 access_hr_expense_line_user hr.expense.line hr.expense.line.user model_hr_expense_line base.group_hr_user 1 1 1 1
4 access_hr_expense_report access_hr_expense_report_manager hr.expense.report hr.expense.report.manager model_hr_expense_report base.group_hr_manager 1 1 1 1
5 access_product_product_hr_expense access_product_product_hr_expense_user product.product.hr.expense product.product.hr.expense.user product.model_product_product base.group_hr_user 1 0 1 0 1 0 1
6 access_product_template_hr_expense access_product_template_hr_expense_user product.template.hr.expense product.template.hr.expense.user product.model_product_template base.group_hr_user 1 0 1 0 1 0 1
7 access_product_uom_hr_expense access_product_uom_hr_expense_user product.uom.hr.expense product.uom.hr.expense.user product.model_product_uom base.group_hr_user 1 0 1 0 1 0 1
8 access_product_price_type access_product_price_type_user product.price.type product.price.type.user product.model_product_price_type base.group_hr_user 1 1 1 1
9 access_hr_expense_expense_manager access_account_journal_user hr.expense.expense.manager account.journal.user model_hr_expense_expense account.model_account_journal base.group_hr_manager base.group_hr_user 1 1 1 1
10 access_hr_expense_expense_system access_account_invoice_user hr.expense.expense.system account.invoice.user model_hr_expense_expense account.model_account_invoice base.group_system base.group_hr_user 1 0 1 0 1 0 1
11 access_hr_expense_line_manager access_account_invoice_line_user hr.expense.line.manager account.invoice.line.user model_hr_expense_line account.model_account_invoice_line base.group_hr_manager base.group_hr_user 1 1 1 1
12 access_product_product_hr_expense_manager access_account_analytic_journal_user product.product.hr.expense.manager account.ianalytic.journal.user product.model_product_product account.model_account_analytic_journal base.group_hr_manager base.group_hr_user 1 1 1 1
13 access_product_template_hr_expense_manager access_account_invoice_tax_user product.template.hr.expense.manager account.invoice.tax.user product.model_product_template account.model_account_invoice_tax base.group_hr_manager base.group_hr_user 1 1 1 1
14 access_product_uom_hr_expense_manager access_account_period_user product.uom.hr.expense.manager account.period.user product.model_product_uom account.model_account_period base.group_hr_manager base.group_hr_user 1 1 1 1
15 access_product_price_type_manager access_account_fiscalyear_user product.price.type.manager account.fiscalyear.user product.model_product_price_type account.model_account_fiscalyear base.group_hr_manager base.group_hr_user 1 1 1 1
16 access_hr_expense_expense_employee access_account_move_user hr.expense.expense.employee account.move.user model_hr_expense_expense account.model_account_move base.group_user base.group_hr_user 1 0 1 0 1 0 1
17 access_hr_employee_employee access_account_move_line_user hr.employee.employee account.move.line.user hr.model_hr_employee account.model_account_move_line base.group_user base.group_hr_user 1 0 1 0 1 0 1
18 access_hr_expense_line_employee access_account_analytic_line_user hr.expense.line.employee account.ianalytic.line.user model_hr_expense_line account.model_account_analytic_line base.group_user base.group_hr_user 1 0 1 0 1 0 1

View File

@ -2,7 +2,7 @@
<openerp>
<data>
<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 id="base.menu_hr_dasboard" name="Dashboard" parent="hr.menu_hr_reporting" sequence="0" groups="base.group_hr_user"/>
<menuitem
action="hr.open_board_hr"
icon="terp-graph"

View File

@ -141,7 +141,7 @@ class hr_holidays(osv.osv):
return False
_columns = {
'name': fields.char('Description', required=True, readonly=True, size=64, states={'draft':[('readonly',False)]}),
'name': fields.char('Description', required=True, size=64),
'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)]}),

View File

@ -52,13 +52,13 @@
<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')])]"/>
<field name="groups" eval="[(6,0,[ref('base.group_hr_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')])]"/>
<field name="groups" eval="[(6,0,[ref('base.group_hr_manager')])]"/>
</record>
</data>

View File

@ -66,7 +66,7 @@
<field name="arch" type="xml">
<form string="Leave Request">
<group col="8" colspan="4">
<field name="name" />
<field name="name" attrs="{'readonly':[('state','!=','draft'),('state','!=','confirm')]}" />
<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')]}"/>
@ -269,6 +269,7 @@
<field name="res_model">hr.holidays</field>
<field name="view_type">form</field>
<field name="view_id" ref="edit_holiday_new"/>
<field name="context">{"search_default_department_id": department_id}</field>
<field name="domain">[('type','=','remove')]</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>
@ -302,7 +303,7 @@
<field name="name">Allocation Requests</field>
<field name="res_model">hr.holidays</field>
<field name="view_type">form</field>
<field name="context">{'search_default_user_id':uid,'type':'add'}</field>
<field name="context">{'search_default_user_id':uid,'type':'add',"search_default_department_id": department_id}</field>
<field name="domain">[('type','=','add')]</field>
<field name="view_id" ref="allocation_leave_new"/>
<field name="search_view_id" ref="view_hr_holidays_filter"/>
@ -330,7 +331,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">{'allocation_type':'company', 'report':True}</field>
<field name="context">{'allocation_type':'company', 'report':True,"search_default_department_id": department_id}</field>
<field name="search_view_id" ref="view_hr_holidays_filter"/>
</record>
@ -379,7 +380,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="Holidays" 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_hr_manager"/>
<menuitem name="Leave Type"
action="open_view_holiday_status"
id="menu_open_view_holiday_status"

View File

@ -40,6 +40,12 @@ class available_holidays_report(osv.osv):
'remaining_leave': fields.float('Remaining Leaves', readonly=True),
'department_id': fields.many2one('hr.department', 'Department', readonly=True),
'user_id': fields.many2one('res.users', 'User', readonly=True),
'state': fields.selection([('draft', 'Draft'),
('confirm', 'Waiting Validation'),
('refuse', 'Refused'),
('validate', 'Validated'),
('cancel', 'Cancelled')]
,'State', readonly=True),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'available_holidays_report')

View File

@ -11,6 +11,7 @@
<field name="arch" type="xml">
<tree string="Available Holidays">
<field name="employee_id" invisible="1"/>
<field name="user_id" invisible="1"/>
<field name="category_id" invisible="1"/>
<field name="holiday_status_id" invisible="1"/>
<field name="department_id" invisible="1"/>
@ -18,6 +19,7 @@
<field name="month" invisible="1"/>
<field name="year" invisible="1"/>
<field name="date" invisible="1"/>
<field name="state" invisible="1"/>
<field name="max_leave" sum="Allocated Leaves"/>
<field name="taken_leaves" sum="Taken Leaves"/>
<field name="remaining_leave" sum="Remaining Leaves"/>
@ -48,13 +50,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="Available Leaves of 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="Available Leaves of 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="Available Leaves of last month"/>
<separator orientation="vertical"/>
<filter string="Validated" icon="terp-camera_test" domain="[('state','=','validate')]"/>
<separator orientation="vertical"/>
<field name="employee_id"/>
</group>
@ -65,13 +65,19 @@
</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"
<filter icon="terp-personal" string="Employee"
name="user" context="{'group_by':'employee_id'}"
help="Leaves by employee"/>
<separator orientation="vertical"/>
<filter string="Validation User" name="User" icon="terp-personal" context="{'group_by':'user_id'}"/>
<separator orientation="vertical"/>
<filter string="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'}"/>
<filter string="Month" icon="terp-go-month" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>

View File

@ -100,7 +100,6 @@ class report_custom(report_rml):
today=datetime.datetime.today()
first_date=data['form']['date_from']
som = strToDate(first_date)
eom = som+datetime.timedelta(59)
day_diff=eom-som

View File

@ -64,9 +64,9 @@ class hr_holidays_report(osv.osv):
s.employee_id,
s.category_id,
s.user_id as user_id,
to_char(s.create_date, 'YYYY') as year,
to_char(s.create_date, 'MM') as month,
to_char(s.create_date, 'YYYY-MM-DD') as day,
to_char(s.date_from, 'YYYY') as year,
to_char(s.date_from, 'MM') as month,
to_char(s.date_from, 'YYYY-MM-DD') as day,
s.holiday_status_id,
s.department_id,
s.state,

View File

@ -54,7 +54,7 @@
<separator orientation="vertical"/>
<filter string="Future Leaves" icon="terp-gtk-media-pause" domain="[('state', 'in' ,('draft','confirm'))]"
help = "Draft and Confirmed leaves"/>
<filter string="Validated" icon="terp-camera_test" domain="[('state','=','validate')]"
<filter string="Validated" name="Validated" icon="terp-camera_test" domain="[('state','=','validate')]"
help = "Pending Leaves"/>
<filter icon="gtk-cancel" string="Cancelled" domain="[('state','=','cancel')]"/>
<separator orientation="vertical"/>
@ -75,7 +75,7 @@
<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'}"/>
<filter string="Validation 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"/>
@ -85,20 +85,20 @@
<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"/>
<filter string="Day" icon="terp-go-today" context="{'group_by':'day'}" help="Creation Date"/>
<filter string="Month" icon="terp-go-month" context="{'group_by':'month'}" help="Creation Date"/>
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}" help="Creation Date"/>
</group>
</search>
</field>
</record>
<record id="action_hr_holidays_report_all" model="ir.actions.act_window">
<field name="name">Leaves</field>
<field name="name">Leaves Analysis</field>
<field name="res_model">hr.holidays.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="context">{"search_default_user_id": uid, 'search_default_month':1, 'search_default_department':1, 'group_by':[], 'group_by_no_leaf':1} </field>
<field name="context">{"search_default_user_id": uid, 'search_default_month':1, 'search_default_Employee':1,'search_default_department':1,"search_default_Validated":1, 'group_by':[], 'group_by_no_leaf':1} </field>
<field name="search_view_id" ref="view_hr_holidays_report_search"/>
</record>

View File

@ -1,15 +1,7 @@
"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,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,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_hr_holydays_status_user","hr.holidays.status user","model_hr_holidays_status","base.group_hr_user",1,1,1,1
"access_hr_holidays_user","hr.holidays.user","model_hr_holidays","base.group_hr_user",1,1,1,1
"access_hr_holidays_remain_user","hr.holidays.ramain.user","model_hr_holidays_remaining_leaves_user","base.group_hr_user",1,1,1,1
"access_hr_holidays_report_manager","hr.holidays.report.manager","model_hr_holidays_report","base.group_hr_manager",1,1,1,1
"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
"access_available_holidays_report_user","hr.available.holidays.report.user","model_available_holidays_report","base.group_hr_user",1,1,1,1

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 1 0 1 0 1
3 access_hr_holidays_user hr.holidays.user model_hr_holidays base.group_hr_user 1 1 1 0 1
4 access_hr_holydays_status_manager access_hr_holidays_remain_user hr.holidays.status.manager hr.holidays.ramain.user model_hr_holidays_status model_hr_holidays_remaining_leaves_user base.group_hr_manager base.group_hr_user 1 1 1 1
5 access_hr_holidays_manager access_hr_holidays_report_manager hr.holidays.manager hr.holidays.report.manager model_hr_holidays model_hr_holidays_report 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 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
6 access_resource_calendar_leaves_manager resource_calendar_leaves_manager resource.model_resource_calendar_leaves base.group_hr_manager 1 1 1 1
7 access_available_holidays_report_user hr.available.holidays.report.user model_available_holidays_report base.group_hr_user 1 1 1 0 1

View File

@ -30,7 +30,7 @@ class hr_holidays_summary_dept(osv.osv_memory):
_columns = {
'date_from': fields.date('From', required=True),
'depts': fields.many2many('hr.department', 'summary_dept_rel', 'sum_id', 'dept_id', 'Department(s)'),
'holiday_type': fields.selection([('Validated','Validated'),('Confirmed','Confirmed'),('both','Both Validated and Confirmed')], 'Select Holiday Type', required=True)
'holiday_type': fields.selection([('Validated','Validated'),('Confirmed','Confirmed'),('both','Both Validated and Confirmed')], 'Leave Type', required=True)
}
_defaults = {

View File

@ -9,16 +9,15 @@
<field name="arch" type="xml">
<form string="Holidays by Department">
<group col="4" colspan="6">
<field name="date_from"/>
<field name="date_from" />
<newline/>
<field name="holiday_type"/>
<field name="holiday_type" colspan="4"/>
<newline/>
<field name="depts"/>
</group>
<separator colspan="4"/>
<group col="2" colspan="4">
<button special="cancel" string="Cancel" icon='gtk-cancel'/>
<button name="print_report" string="Print" colspan="1" type="object" icon="gtk-yes"/>
<field name="depts" colspan="4"/>
<separator colspan="4"/>
<label align="0.0" colspan="2" string="" />
<button colspan="1" icon="gtk-cancel" special="cancel" string="Cancel"/>
<button colspan="1" icon="gtk-print" name="print_report" string="Print" type="object"/>
</group>
</form>
</field>
@ -42,4 +41,4 @@
icon="STOCK_PRINT"/>
</data>
</openerp>
</openerp>

View File

@ -181,15 +181,15 @@ class hr_applicant(crm.crm_case, osv.osv):
}
def onchange_job(self,cr, uid, ids, job, context=None):
job_obj = self.pool.get('hr.job')
if context is None:
context = {}
result = {}
if job:
job_obj = self.pool.get('hr.job')
result['department_id'] = job_obj.browse(cr, uid, job, context=context).department_id.id
return {'value': result}
return {'value': {'department_id': []}}
return {'value': {'department_id': False}}
def stage_previous(self, cr, uid, ids, context=None):
"""This function computes previous stage for case from its current stage
@ -437,8 +437,9 @@ class hr_applicant(crm.crm_case, osv.osv):
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'})
if expected_emp == 0:
job_obj.write(cr,uid, [applicant.job_id.id],{'state':'old'})
job_obj.write(cr,uid, [applicant.job_id.id],{'expected_employees':expected_emp})
return res
def case_reset(self, cr, uid, ids, *args):
@ -449,8 +450,18 @@ class hr_applicant(crm.crm_case, osv.osv):
@param ids: List of case Ids
@param *args: Tuple Value for additional Params
"""
applicant = self.browse(cr, uid, ids)[0]
if applicant.job_id :
job_obj = self.pool.get('hr.job')
emp_obj = self.pool.get('hr.employee')
job_data = job_obj.browse(cr,uid, applicant.job_id.id)
expected_emp = job_data['expected_employees'] + 1
emp_id = emp_obj.search(cr,uid, [('job_id','=',applicant.job_id.id),('name','=',applicant.name)])
emp_obj.unlink(cr, uid, emp_id)
job_obj.write(cr,uid, [applicant.job_id.id],{'expected_employees':expected_emp})
res = super(hr_applicant, self).case_reset(cr, uid, ids, *args)
self.write(cr, uid, ids, {'date_open': False, 'date_closed':False})
return res

View File

@ -8,7 +8,7 @@
<field name="res_model">hr.applicant</field>
<field name="view_mode">tree,form,graph,calendar</field>
<field name="view_id" ref="crm_case_tree_view_job"/>
<field name="context">{"search_default_user_id":uid, 'search_default_current': 1}</field>
<field name="context">{"search_default_user_id":uid, 'search_default_current': 1,"search_default_department_id": department_id}</field>
<field name="search_view_id" ref="view_crm_case_jobs_filter"/>
</record>

View File

@ -114,7 +114,7 @@
<group col="2" colspan="2">
<separator colspan="2" string="Qualification"/>
<!-- <field name="type_id" domain="[('object_id.model', '=', 'hr.applicant')]"/>-->
<field name="type_id"/>
<field name="type_id" widget="selection"/>
<field name="priority" string="Appreciation"/>
<field name="reference"/>
</group>

View File

@ -67,7 +67,7 @@
icon="terp-document-new"
domain="[('state','=','draft')]"
help = "Draft recruitment"/>
<filter string="Current"
<filter string="In progress"
icon="terp-check"
domain="[('state', '=' ,'open')]"
help = "In progress recruitment"/>
@ -91,36 +91,33 @@
</group>
<newline/>
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="job_id" widget="selection"/>
<field name="type_id" widget="selection"/>
<!--field name="job_id"/-->
<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" string="Creation 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'}" />
<filter string="Partner" icon="terp-partner" 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="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}" />
<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="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'}"/>
<filter string="Day" name = "day" icon="terp-go-today" domain="[]" context="{'group_by':'day'}" help="Creation Date"/>
<filter string="Month" icon="terp-go-month" domain="[]" context="{'group_by':'month'}" help="Creation Date"/>
<filter string="Year" icon="terp-go-year" domain="[]" context="{'group_by':'year'}" help="Creation Date"/>
</group>
</search>
</field>
</record>

View File

@ -3,8 +3,7 @@
"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,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,1,1,1
"access_hr_recruitment_degree_manager","hr.recruitment.degree.manager","model_hr_recruitment_degree","base.group_hr_manager",1,1,1,1
"access_mailgate_message_user","mailgate.message.user","mail_gateway.model_mailgate_message","base.group_hr_user",1,1,1,1
"access_res_partner_hr_user","res.partner.user","base.model_res_partner","base.group_hr_user",1,1,1,1
"access_res_partner_address_hr_user","res.partner.address.user","base.model_res_partner_address","base.group_hr_user",1,1,1,1
"access_survey_hr_user","survey.hr.user","survey.model_survey","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
3 access_hr_recruitment_report hr.recruitment.report model_hr_recruitment_report base.group_hr_manager 1 1 1 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 access_mailgate_message_user hr.recruitment.stage.system mailgate.message.user model_hr_recruitment_stage mail_gateway.model_mailgate_message base.group_system base.group_hr_user 1 1 1 1
7 access_hr_applicant_manager access_res_partner_hr_user hr.applicant.manager res.partner.user model_hr_applicant base.model_res_partner base.group_hr_manager base.group_hr_user 1 1 1 1
8 access_hr_applicant_system access_res_partner_address_hr_user hr.applicant.system res.partner.address.user model_hr_applicant base.model_res_partner_address base.group_system base.group_hr_user 1 0 1 0 1 0 1
9 access_hr_recruitment_stage_manager access_survey_hr_user hr.recruitment.stage.manager survey.hr.user model_hr_recruitment_stage survey.model_survey base.group_hr_manager base.group_hr_user 1 1 1 1 0
access_hr_recruitment_degree_manager hr.recruitment.degree.manager model_hr_recruitment_degree base.group_hr_manager 1 1 1 1

View File

@ -63,7 +63,7 @@ class report_custom(report_rml):
"and product_uom_id = unit.id "\
"and line.user_id=%s and line.date >= %s and line.date < %s "
"order by line.date",
(data['form']['user_id'], som.strftime('%Y-%m-%d'), eom.strftime('%Y-%m-%d')))
(uid, som.strftime('%Y-%m-%d'), eom.strftime('%Y-%m-%d')))
# Sum attendence by account, then by day
accounts = {}
@ -97,7 +97,7 @@ class report_custom(report_rml):
account_xml.append('</account>')
# Computing the employee
cr.execute("select name from res_users where id=%s", (data['form']['user_id'],))
cr.execute("select name from res_users where id=%s", (str(uid)))
emp = cr.fetchone()[0]
# Computing the xml

View File

@ -59,7 +59,7 @@ def emp_create_xml(cr, id, som, eom):
time_xml = ([xml % (day, amount) for day, amount in month.iteritems()])
# Computing the employee
cr.execute("select name from res_users where id=%s", (id,))
cr.execute("select name from resource_resource where id=%s", (id,))
emp = cr.fetchone()[0]
# Computing the xml
@ -91,9 +91,11 @@ class report_custom(report_rml):
date_xml.append('<cols>2.5cm%s,2cm</cols>\n' % (',0.7cm' * lengthmonth(som.year, som.month)))
emp_xml=''
for id in data['form']['user_ids']:
emp_xml += emp_create_xml(cr, id, som, eom)
emp_obj = pooler.get_pool(cr.dbname).get('hr.employee')
for id in data['form']['employee_ids']:
user = emp_obj.browse(cr, uid, id).user_id.id
if user:
emp_xml += emp_create_xml(cr, id, som, eom)
# Computing the xml
#Without this, report don't show non-ascii characters (TO CHECK)
date_xml = '\n'.join(date_xml)

View File

@ -1,16 +1,8 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_hr_analytic_timesheet","hr.analytic.timesheet","model_hr_analytic_timesheet","base.group_hr_user",1,1,1,1
"access_hr_account_analytic_line","account.account.analytic.line","account.model_account_analytic_line","base.group_hr_user",1,1,1,0
"access_account_analytic_journal","account.account.analytic.journal","account.model_account_analytic_journal","base.group_hr_user",1,0,0,0
"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,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
"access_hr_account_analytic_line","account.account.analytic.line","account.model_account_analytic_line","base.group_hr_user",1,1,1,1
"access_account_analytic_journal","account.account.analytic.journal","account.model_account_analytic_journal","base.group_hr_user",1,1,1,1
"access_product_product_user","product.product user","product.model_product_product","base.group_hr_user",1,1,1,1
"access_product_template_hr_timesheet","product.template.hr.timesheet","product.model_product_template","base.group_hr_user",1,1,1,1
"access_product_uom_hr_timesheet","product.uom.hr.timesheet","product.model_product_uom","base.group_hr_user",1,1,1,1
"access_account_fiscalyear_hr_user","account.account.fiscalyear.user","account.model_account_fiscalyear","base.group_hr_user",1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_hr_analytic_timesheet hr.analytic.timesheet model_hr_analytic_timesheet base.group_hr_user 1 1 1 1
3 access_hr_account_analytic_line account.account.analytic.line account.model_account_analytic_line base.group_hr_user 1 1 1 0 1
4 access_account_analytic_journal account.account.analytic.journal account.model_account_analytic_journal base.group_hr_user 1 0 1 0 1 0 1
5 access_product_product_user product.product user product.model_product_product base.group_hr_user 1 0 1 0 1 0 1
6 access_product_template_hr_timesheet product.template.hr.timesheet product.model_product_template base.group_hr_user 1 0 1 0 1 0 1
7 access_product_uom_hr_timesheet product.uom.hr.timesheet product.model_product_uom base.group_hr_user 1 0 1 0 1 0 1
8 access_hr_analytic_timesheet_manager access_account_fiscalyear_hr_user hr.analytic.timesheet.manager account.account.fiscalyear.user model_hr_analytic_timesheet account.model_account_fiscalyear base.group_hr_manager base.group_hr_user 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

View File

@ -5,7 +5,7 @@
import netsvc, tools, os, time
month = time.gmtime()[1]
year = time.gmtime()[0]
data_dict = {'model': 'ir.ui.menu', 'form': {'month': month, 'year' : year, 'user_id' : uid }}
data_dict = {'model': 'ir.ui.menu', 'form': {'month': month, 'year' : year, 'employee_id' : ref('hr.employee1') }}
(data, format) = netsvc.LocalService('report.hr.analytical.timesheet').create(cr, uid, [], data_dict, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet-user_report.'+format), 'wb+').write(data)
@ -17,7 +17,7 @@
import netsvc, tools, os, time
month = time.gmtime()[1]
year = time.gmtime()[0]
data_dict = {'model': 'ir.ui.menu', 'form': {'month': month, 'year' : year, 'user_ids' : [uid] }}
data_dict = {'model': 'ir.ui.menu', 'form': {'month': month, 'year' : year, 'employee_ids' : [ref('hr.employee1')] }}
(data, format) = netsvc.LocalService('report.hr.analytical.timesheet_users').create(cr, uid, [], data_dict, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet-users_report.'+format), 'wb+').write(data)
file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet-users_report.'+format), 'wb+').write(data)

View File

@ -21,7 +21,6 @@
context_lang: en_US
groups_id:
- base.group_hr_user
- base.group_hr_attendance
- base.group_user
- base.group_extended
- base.group_hr_manager

View File

@ -21,6 +21,7 @@
import datetime
from osv import osv, fields
from tools.translate import _
class analytical_timesheet_employee(osv.osv_memory):
_name = 'hr.analytical.timesheet.employee'
@ -29,18 +30,24 @@ class analytical_timesheet_employee(osv.osv_memory):
'month': fields.selection([(x, datetime.date(2000, x, 1).strftime('%B')) for x in range(1, 13)],
'Month', required=True),
'year': fields.integer('Year', required=True),
'user_id': fields.many2one('res.users', 'User', required=True)
'employee_id': fields.many2one('hr.employee', 'Employee', required=True)
}
def _get_user(self, cr, uid, context=None):
emp_obj = self.pool.get('hr.employee')
if context is None:
context = {}
return uid
emp_id = emp_obj.search(cr, uid, [('user_id', '=', uid)], context=context)
if not emp_id:
raise osv.except_osv(_("Warning"), _("No employee defined for this user"))
return emp_id and emp_id[0] or False
_defaults = {
'month': datetime.date.today().month,
'year': datetime.date.today().year,
'user_id': _get_user
'employee_id': _get_user
}
def print_report(self, cr, uid, ids, context=None):
@ -59,4 +66,4 @@ class analytical_timesheet_employee(osv.osv_memory):
}
analytical_timesheet_employee()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -8,12 +8,11 @@
<field name="model">hr.analytical.timesheet.employee</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Employee Timesheet">
<form string="Monthly Employee Timesheet">
<group colspan="4">
<separator string="This wizard will print monthly timesheet of employee" colspan="4"/>
<field name="month"/>
<field name="year"/>
<field name="user_id" colspan="3"/>
<field name="employee_id" colspan="3"/>
</group>
<separator colspan="4"/>
<group colspan="4" col="6">

View File

@ -30,7 +30,7 @@ class analytical_timesheet_employees(osv.osv_memory):
'month': fields.selection([(x, datetime.date(2000, x, 1).strftime('%B')) for x in range(1, 13)],
'Month', required=True),
'year': fields.integer('Year', required=True),
'user_ids': fields.many2many('res.users', 'timesheet_users_rel', 'timesheet_id', 'user_id', 'Users', required=True)
'employee_ids': fields.many2many('hr.employee', 'timesheet_employee_rel', 'timesheet_id', 'employee_id', 'employees', required=True)
}
_defaults = {
@ -55,4 +55,4 @@ class analytical_timesheet_employees(osv.osv_memory):
analytical_timesheet_employees()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -8,16 +8,16 @@
<field name="model">hr.analytical.timesheet.users</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Employees Timesheet">
<form string="Monthly Employees Timesheet">
<group height="260" width="460">
<group colspan="4">
<separator string="This wizard will print monthly timesheet of employees" colspan="4"/>
<field name="month"/>
<field name="year"/>
<field name="user_ids" colspan="4"/>
<separator string="Employees" colspan="4"/>
<field name="employee_ids" colspan="4" nolabel="1"/>
</group>
<separator colspan="4"/>
<group colspan="4" col="6">
<group colspan="4">
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="gtk-print" string="Print" name="print_report" type="object"/>
</group>

View File

@ -1,20 +1,16 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_hr_timesheet_invoice_factor_hr_user","hr_timesheet_invoice.factor.hr.user","model_hr_timesheet_invoice_factor","base.group_hr_user",1,0,0,0
"access_hr_timesheet_invoice_factor_hr_user","hr_timesheet_invoice.factor.hr.user","model_hr_timesheet_invoice_factor","base.group_hr_user",1,1,1,1
"access_hr_timesheet_invoice_factor_acc_inv","hr_timesheet_invoice.factor.account.invoice","model_hr_timesheet_invoice_factor","account.group_account_invoice",1,1,1,1
"access_report_analytic_account_close","report.analytic.account.close","model_report_analytic_account_close","account.group_account_manager",1,0,0,0
"access_report_account_analytic_line_to_invoice","report.account.analytic.line.to.invoice","model_report_account_analytic_line_to_invoice","account.group_account_manager",1,0,0,0
"access_report_timesheet_user","report_timesheet.user","model_report_timesheet_user","base.group_hr_manager",1,0,0,0
"access_report_timesheet_account","report_timesheet.account","model_report_timesheet_account","base.group_hr_manager",1,0,0,0
"access_report_timesheet_account_date","report_timesheet.account.date","model_report_timesheet_account_date","base.group_hr_manager",1,0,0,0
"access_report_timesheet_invoice","report_timesheet.invoice","model_report_timesheet_invoice","base.group_hr_manager",1,0,0,0
"access_report_random_timesheet","report_random_timesheet","model_report_random_timesheet","base.group_hr_manager",1,0,0,0
"access_report_random_timesheet_lines","random_timesheet_lines","model_random_timesheet_lines","base.group_hr_manager",1,0,0,0
"access_report_analytic_account_close_system","report.analytic.account.close system","model_report_analytic_account_close","base.group_system",1,1,1,1
"access_report_account_analytic_line_to_invoice_system","report.account.analytic.line.to.invoice system","model_report_account_analytic_line_to_invoice","base.group_system",1,1,1,1
"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_report_timesheet_user","report_timesheet.user","model_report_timesheet_user","base.group_hr_manager",1,1,1,1
"access_report_timesheet_account","report_timesheet.account","model_report_timesheet_account","base.group_hr_manager",1,1,1,1
"access_report_timesheet_account_date","report_timesheet.account.date","model_report_timesheet_account_date","base.group_hr_manager",1,1,1,1
"access_report_timesheet_invoice","report_timesheet.invoice","model_report_timesheet_invoice","base.group_hr_manager",1,1,1,1
"access_report_random_timesheet","report_random_timesheet","model_report_random_timesheet","base.group_hr_manager",1,1,1,1
"access_report_random_timesheet_lines","random_timesheet_lines","model_random_timesheet_lines","base.group_hr_manager",1,1,1,1
"access_report_analytic_account_close_manager","report.analytic.account.close.manager","model_report_analytic_account_close","base.group_hr_manager",1,1,1,1
"access_report_account_analytic_line_to_invoice_manager","report.account.analytic.line.to.invoice.manager","model_report_account_analytic_line_to_invoice","base.group_hr_manager",1,1,1,1
"access_account_invoice_hr_user","account.invoice.hr.user","account.model_account_invoice","base.group_hr_user",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
"access_report_timesheet_line_employee","report.timesheet.line.employee","model_report_timesheet_line","base.group_hr_user",1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_hr_timesheet_invoice_factor_hr_user hr_timesheet_invoice.factor.hr.user model_hr_timesheet_invoice_factor base.group_hr_user 1 0 1 0 1 0 1
3 access_hr_timesheet_invoice_factor_acc_inv hr_timesheet_invoice.factor.account.invoice model_hr_timesheet_invoice_factor account.group_account_invoice 1 1 1 1
4 access_report_analytic_account_close report.analytic.account.close model_report_analytic_account_close account.group_account_manager 1 0 0 0
5 access_report_account_analytic_line_to_invoice report.account.analytic.line.to.invoice model_report_account_analytic_line_to_invoice account.group_account_manager 1 0 0 0
6 access_report_timesheet_user report_timesheet.user model_report_timesheet_user base.group_hr_manager 1 0 1 0 1 0 1
7 access_report_timesheet_account report_timesheet.account model_report_timesheet_account base.group_hr_manager 1 0 1 0 1 0 1
8 access_report_timesheet_account_date report_timesheet.account.date model_report_timesheet_account_date base.group_hr_manager 1 0 1 0 1 0 1
9 access_report_timesheet_invoice report_timesheet.invoice model_report_timesheet_invoice base.group_hr_manager 1 0 1 0 1 0 1
10 access_report_random_timesheet report_random_timesheet model_report_random_timesheet base.group_hr_manager 1 0 1 0 1 0 1
11 access_report_random_timesheet_lines random_timesheet_lines model_random_timesheet_lines base.group_hr_manager 1 0 1 0 1 0 1
12 access_report_analytic_account_close_system access_report_analytic_account_close_manager report.analytic.account.close system report.analytic.account.close.manager model_report_analytic_account_close base.group_system base.group_hr_manager 1 1 1 1
13 access_report_account_analytic_line_to_invoice_system access_report_account_analytic_line_to_invoice_manager report.account.analytic.line.to.invoice system report.account.analytic.line.to.invoice.manager model_report_account_analytic_line_to_invoice base.group_system base.group_hr_manager 1 1 1 1
14 access_report_timesheet_line access_account_invoice_hr_user report.timesheet.line account.invoice.hr.user model_report_timesheet_line account.model_account_invoice base.group_hr_manager base.group_hr_user 1 0 1 0 1 0 1
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
15 access_account_invoice_tax_hr_manager account.invoice.tax.hr.manager account.model_account_invoice_tax base.group_hr_manager 1 1 1 1
16 access_report_timesheet_line_employee report.timesheet.line.employee model_report_timesheet_line base.group_user base.group_hr_user 1 1 1 0 1

View File

@ -8,12 +8,14 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Timesheet Profit">
<group height="340" width="480">
<group height="400" width="480">
<group col="4" colspan="6">
<field name="date_from"/>
<field name="date_to"/>
<field name="journal_ids" colspan="4"/>
<field name="employee_ids" colspan="4"/>
<separator string="Journals" colspan="4"/>
<field name="journal_ids" colspan="4" nolabel="1"/>
<separator string="Employees" colspan="4"/>
<field name="employee_ids" colspan="4" nolabel="1"/>
</group>
<separator colspan="4"/>
<group col="2" colspan="4">
@ -39,4 +41,4 @@
parent="hr_timesheet.menu_hr_reporting_timesheet" groups="base.group_extended" icon="STOCK_PRINT"/>
</data>
</openerp>
</openerp>

View File

@ -67,19 +67,19 @@
<button icon="terp-gtk-go-back-rtl" name="date_next" string="" type="object"/>
</group>
<field colspan="3" context="name=date_current,user_id=user_id" height="100" name="attendances_ids" nolabel="1" groups="base.group_hr_attendance">
<field colspan="3" context="name=date_current,user_id=user_id" height="100" name="attendances_ids" nolabel="1">
<tree string="Attendances" editable="bottom">
<field name="name"/>
<field name="action"/>
<field invisible="1" name="employee_id"/>
</tree>
</field>
<group col="1" colspan="1" groups="base.group_hr_attendance">
<group col="1" colspan="1">
<button name="sign_in" string="Sign In" type="object" icon="terp-gtk-jump-to-ltr"/>
<button name="sign_out" string="Sign Out" type="object" icon="terp-gtk-jump-to-rtl"/>
</group>
<field name="state_attendance" groups="base.group_hr_attendance"/>
<field name="total_attendance_day" widget="float_time" groups="base.group_hr_attendance"/>
<field name="state_attendance"/>
<field name="total_attendance_day" widget="float_time"/>
<field colspan="4" context="date=date_current,user_id=user_id" domain="[('name','=',date_current)]" name="timesheet_ids" nolabel="1">
<tree editable="top" string="Timesheet">
<field invisible="1" name="date"/>
@ -115,9 +115,9 @@
<field colspan="4" name="period_ids" nolabel="1">
<tree colors="red:total_difference&lt;0.1;blue:total_difference&gt;=0.1" string="Period">
<field name="name"/>
<field name="total_attendance" widget="float_time" groups="base.group_hr_attendance"/>
<field name="total_attendance" widget="float_time"/>
<field name="total_timesheet" widget="float_time"/>
<field name="total_difference" widget="float_time" groups="base.group_hr_attendance"/>
<field name="total_difference" widget="float_time"/>
</tree>
</field>
<group colspan="4" col="6">
@ -303,9 +303,9 @@
<field name="date_from"/>
<field name="date_to"/>
<field name="department_id"/>
<field name="total_attendance" groups="base.group_hr_attendance"/>
<field name="total_attendance"/>
<field name="total_timesheet"/>
<field name="total_difference" groups="base.group_hr_attendance"/>
<field name="total_difference"/>
<field name="state"/>
</tree>
</field>

View File

@ -35,7 +35,7 @@ class timesheet_report(osv.osv):
'name': fields.char('Description', size=64,readonly=True),
'product_id' : fields.many2one('product.product', 'Product'),
'general_account_id' : fields.many2one('account.account', 'General Account', readonly=True),
'user_id': fields.many2one('res.users', 'User',readonly=True),
'employee_id': fields.many2one('hr.employee', 'Employee',readonly=True),
'to_invoice': fields.many2one('hr_timesheet_invoice.factor', 'Type of Invoicing',readonly=True),
'account_id': fields.many2one('account.analytic.account', 'Analytic Account',readonly=True),
'nbr': fields.integer('#Nbr',readonly=True),
@ -60,8 +60,8 @@ class timesheet_report(osv.osv):
tools.drop_view_if_exists(cr, 'timesheet_report')
cr.execute("""
create or replace view timesheet_report as (
select
min(aal.id) as id,
select
min(aal.id) as id,
htss.date_current,
htss.name,
htss.date_from,
@ -91,14 +91,14 @@ class timesheet_report(osv.osv):
AND day.name = sheet.date_current) where sheet.id=htss.id) as total_attendance,
aal.to_invoice,
aal.general_account_id,
htss.user_id,
htss.employee_id as employee_id,
htss.company_id,
htss.department_id,
htss.state
from account_analytic_line as aal
left join hr_analytic_timesheet as hat ON (hat.line_id=aal.id)
left join hr_timesheet_sheet_sheet as htss ON (hat.line_id=htss.id)
group by
from hr_timesheet_sheet_sheet as htss
left join hr_analytic_timesheet as hat ON (hat.create_uid=htss.create_uid)
left join account_analytic_line as aal ON (hat.line_id=aal.id)
group by
to_char(htss.date_current,'YYYY'),
to_char(htss.date_current,'MM'),
to_char(htss.date_current, 'YYYY-MM-DD'),
@ -116,7 +116,8 @@ class timesheet_report(osv.osv):
htss.state,
htss.id,
htss.department_id,
htss.user_id
htss.employee_id
)
""")
timesheet_report()

View File

@ -7,7 +7,7 @@
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Timesheet" type="bar">
<field name="user_id" />
<field name="employee_id" />
<field name="quantity" operator = "+"/>
<field name="state" group = "True"/>
</graph>
@ -21,7 +21,7 @@
<tree colors="blue:state in ('draft');black:state in ('confirm','new');gray:state in('cancel')" string="Timesheet">
<field name="date_current" invisible="1"/>
<field name="name" invisible="1"/>
<field name="user_id" invisible="1"/>
<field name="employee_id" invisible="1"/>
<field name="date_from" invisible="1"/>
<field name="date_to" invisible="1"/>
<field name="state" invisible="1"/>
@ -90,7 +90,7 @@
</group>
<newline/>
<group expand="1" string="Group By...">
<filter string="User" name="User_id" icon="terp-personal" context="{'group_by':'user_id'}"/>
<filter string="Employee" name="Employee_id" 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'}"/>
@ -117,7 +117,7 @@
<field name="res_model">timesheet.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_id':1,'group_by_no_leaf':1,'group_by':[]}</field>
<field name="context">{'search_default_month':1,'search_default_Employee_id':1,'group_by_no_leaf':1,'group_by':[]}</field>
<field name="search_view_id" ref="view_timesheet_report_search"/>
</record>
<menuitem action="action_timesheet_report_stat_all" id="menu_timesheet_report_all"

View File

@ -1,13 +1,9 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_hr_timesheet_sheet_sheet_user","hr_timesheet_sheet.sheet.user","model_hr_timesheet_sheet_sheet","base.group_hr_user",1,1,1,1
"access_hr_timesheet_sheet_sheet_system_user","hr_timesheet_sheet.sheet.system.user","model_hr_timesheet_sheet_sheet","base.group_user",1,0,0,0
"access_hr_timesheet_sheet_sheet_day","hr_timesheet_sheet.sheet.day","model_hr_timesheet_sheet_sheet_day","base.group_hr_user",1,1,1,1
"access_hr_timesheet_sheet_sheet_account","hr_timesheet_sheet.sheet.account","model_hr_timesheet_sheet_sheet_account","base.group_hr_user",1,1,1,1
"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_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
"access_hr_timesheet_sheet_sheet_day_employee","hr_timesheet_sheet.sheet.day.employee","model_hr_timesheet_sheet_sheet_day","base.group_user",1,0,0,0
"access_hr_timesheet_sheet_sheet_account_employee","hr_timesheet_sheet.sheet.account.employee","model_hr_timesheet_sheet_sheet_account","base.group_user",1,0,0,0
"access_timesheet_report_employee","timesheet.report.employee","model_timesheet_report","base.group_hr_user",1,1,1,1
"access_hr_analytic_timesheet_system_user","hr.analytic.timesheet.system.user","model_hr_analytic_timesheet","base.group_user",1,0,0,0
"access_hr_timesheet_sheet_sheet_day","hr.timesheet.sheet.sheet.day.user","model_hr_timesheet_sheet_sheet_day","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_timesheet_sheet_sheet_user hr_timesheet_sheet.sheet.user model_hr_timesheet_sheet_sheet base.group_hr_user 1 1 1 1
3 access_hr_timesheet_sheet_sheet_system_user hr_timesheet_sheet.sheet.system.user model_hr_timesheet_sheet_sheet base.group_user 1 0 0 0
4 access_hr_timesheet_sheet_sheet_day hr_timesheet_sheet.sheet.day model_hr_timesheet_sheet_sheet_day base.group_hr_user 1 1 1 1
5 access_hr_timesheet_sheet_sheet_account hr_timesheet_sheet.sheet.account model_hr_timesheet_sheet_sheet_account base.group_hr_user 1 1 1 1
6 access_hr_timesheet_report hr.timesheet.report model_hr_timesheet_report base.group_hr_manager 1 1 1 1
7 access_hr_timesheet_sheet_sheet_manager access_timesheet_report_employee hr_timesheet_sheet.sheet.manager timesheet.report.employee model_hr_timesheet_sheet_sheet model_timesheet_report base.group_hr_manager base.group_hr_user 1 1 1 1
8 access_hr_timesheet_sheet_sheet_system access_hr_analytic_timesheet_system_user hr_timesheet_sheet.sheet.system hr.analytic.timesheet.system.user model_hr_timesheet_sheet_sheet model_hr_analytic_timesheet base.group_system base.group_user 1 0 0 0
9 access_timesheet_report_employee access_hr_timesheet_sheet_sheet_day timesheet.report.employee hr.timesheet.sheet.sheet.day.user model_timesheet_report model_hr_timesheet_sheet_sheet_day base.group_user 1 1 0 1 0 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
access_hr_timesheet_sheet_sheet_day_employee hr_timesheet_sheet.sheet.day.employee model_hr_timesheet_sheet_sheet_day base.group_user 1 0 0 0
access_hr_timesheet_sheet_sheet_account_employee hr_timesheet_sheet.sheet.account.employee model_hr_timesheet_sheet_sheet_account base.group_user 1 0 0 0