[FIX] HR useability improvements
bzr revid: fp@openerp.com-20121010192927-6ud5e3zvhp5gabip
This commit is contained in:
commit
5c4348f7fe
|
@ -334,13 +334,10 @@
|
||||||
<field name="state" widget="statusbar" statusbar_visible="recruit,open"/>
|
<field name="state" widget="statusbar" statusbar_visible="recruit,open"/>
|
||||||
</header>
|
</header>
|
||||||
<sheet>
|
<sheet>
|
||||||
<label for="name" class="oe_edit_only"/>
|
<div class="oe_title">
|
||||||
<h1>
|
<label for="name" class="oe_edit_only"/>
|
||||||
<field name="name" class="oe_inline"/>
|
<h1><field name="name" class="oe_inline"/></h1>
|
||||||
<label class="oe_inline" string="(" attrs="{'invisible': [('department_id', '=', False)]}"/>
|
</div>
|
||||||
<field name="department_id" class="oe_inline"/>
|
|
||||||
<label class="oe_inline" string=")" attrs="{'invisible': [('department_id', '=', False)]}"/>
|
|
||||||
</h1>
|
|
||||||
<group>
|
<group>
|
||||||
<group>
|
<group>
|
||||||
<field name="no_of_employee" groups="base.group_user"/>
|
<field name="no_of_employee" groups="base.group_user"/>
|
||||||
|
@ -349,7 +346,7 @@
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||||
</group>
|
<field name="department_id"/> </group>
|
||||||
</group>
|
</group>
|
||||||
<div>
|
<div>
|
||||||
<label for="description"/>
|
<label for="description"/>
|
||||||
|
|
|
@ -9,6 +9,7 @@ access_product_template_hr_expense_user,product.template.hr.expense.user,product
|
||||||
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_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_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_journal_user,account.journal.user,account.model_account_journal,base.group_hr_user,1,1,1,1
|
||||||
|
access_account_journal_employee,account.journal.employee,account.model_account_journal,base.group_user,1,0,0,0
|
||||||
access_account_invoice_user,account.invoice.user,account.model_account_invoice,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_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_analytic_journal_user,account.ianalytic.journal.user,account.model_account_analytic_journal,base.group_hr_user,1,1,1,1
|
||||||
|
|
|
|
@ -353,6 +353,32 @@
|
||||||
|
|
||||||
<menuitem name="My Allocation Requests" parent="menu_open_ask_holidays" id="menu_open_allocation_holidays" action="open_allocation_holidays"/>
|
<menuitem name="My Allocation Requests" parent="menu_open_ask_holidays" id="menu_open_allocation_holidays" action="open_allocation_holidays"/>
|
||||||
|
|
||||||
|
<record model="ir.actions.act_window" id="request_approve_allocation">
|
||||||
|
<field name="name">Allocation Requests to Approve</field>
|
||||||
|
<field name="res_model">hr.holidays</field>
|
||||||
|
<field name="view_type">form</field>
|
||||||
|
<field name="context">{'default_type': 'add', 'search_default_approve':1}</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"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record model="ir.actions.act_window.view" id="action_request_approve_allocation_tree">
|
||||||
|
<field name="sequence" eval="1"/>
|
||||||
|
<field name="view_mode">tree</field>
|
||||||
|
<field name="view_id" ref="view_holiday_allocation_tree"/>
|
||||||
|
<field name="act_window_id" ref="request_approve_allocation"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record model="ir.actions.act_window.view" id="action_request_approve_allocation_form">
|
||||||
|
<field name="sequence" eval="2"/>
|
||||||
|
<field name="view_mode">form</field>
|
||||||
|
<field name="view_id" ref="allocation_leave_new"/>
|
||||||
|
<field name="act_window_id" ref="request_approve_allocation"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<menuitem parent="menu_open_ask_holidays" id="menu_request_approve_allocation" action="request_approve_allocation" groups="base.group_hr_manager"/>
|
||||||
|
|
||||||
<record model="ir.actions.act_window" id="open_company_allocation">
|
<record model="ir.actions.act_window" id="open_company_allocation">
|
||||||
<field name="name">Leaves Summary</field>
|
<field name="name">Leaves Summary</field>
|
||||||
<field name="res_model">hr.holidays</field>
|
<field name="res_model">hr.holidays</field>
|
||||||
|
|
|
@ -342,8 +342,8 @@
|
||||||
attrs="{'invisible':[('survey_id','=',False)]}"/>
|
attrs="{'invisible':[('survey_id','=',False)]}"/>
|
||||||
</div>
|
</div>
|
||||||
</field>
|
</field>
|
||||||
<xpath expr="/form/sheet/h1" version="7.0" position="after">
|
<xpath expr="//div[@class='oe_title']" version="7.0" position="after">
|
||||||
<div colspan="4" attrs="{'invisible': [('alias_domain', '=', False)]}">
|
<div attrs="{'invisible': [('alias_domain', '=', False)]}">
|
||||||
<field name="alias_id" invisible="1" required="0"/>
|
<field name="alias_id" invisible="1" required="0"/>
|
||||||
<label for="alias_name" class="oe_edit_only"/>
|
<label for="alias_name" class="oe_edit_only"/>
|
||||||
<field name="alias_name" nolabel="1" class="oe_inline" attrs="{'required': [('alias_id', '!=', False)]}"/>@<field name="alias_domain" nolabel="1" class="oe_inline"/>
|
<field name="alias_name" nolabel="1" class="oe_inline" attrs="{'required': [('alias_id', '!=', False)]}"/>@<field name="alias_domain" nolabel="1" class="oe_inline"/>
|
||||||
|
|
|
@ -135,6 +135,8 @@ class account_analytic_line(osv.osv):
|
||||||
def _default_general_account(self, cr, uid, context=None):
|
def _default_general_account(self, cr, uid, context=None):
|
||||||
proxy = self.pool.get('hr.employee')
|
proxy = self.pool.get('hr.employee')
|
||||||
record_ids = proxy.search(cr, uid, [('user_id', '=', uid)], context=context)
|
record_ids = proxy.search(cr, uid, [('user_id', '=', uid)], context=context)
|
||||||
|
if not record_ids:
|
||||||
|
raise osv.except_osv(_('Error!'), _('Please create an employee associated to this user.'))
|
||||||
employee = proxy.browse(cr, uid, record_ids[0], context=context)
|
employee = proxy.browse(cr, uid, record_ids[0], context=context)
|
||||||
if employee.product_id and employee.product_id.property_account_income:
|
if employee.product_id and employee.product_id.property_account_income:
|
||||||
return employee.product_id.property_account_income.id
|
return employee.product_id.property_account_income.id
|
||||||
|
|
|
@ -35,7 +35,7 @@ class hr_timesheet_current_open(osv.osv_memory):
|
||||||
|
|
||||||
user_ids = self.pool.get('hr.employee').search(cr, uid, [('user_id','=',uid)], context=context)
|
user_ids = self.pool.get('hr.employee').search(cr, uid, [('user_id','=',uid)], context=context)
|
||||||
if not len(user_ids):
|
if not len(user_ids):
|
||||||
raise osv.except_osv(_('Error!'), _('Please define employee for your user!'))
|
raise osv.except_osv(_('Error!'), _('Please create an employee and associate it with this user.'))
|
||||||
ids = ts.search(cr, uid, [('user_id','=',uid),('state','=','draft'),('date_from','<=',time.strftime('%Y-%m-%d')), ('date_to','>=',time.strftime('%Y-%m-%d'))], context=context)
|
ids = ts.search(cr, uid, [('user_id','=',uid),('state','=','draft'),('date_from','<=',time.strftime('%Y-%m-%d')), ('date_to','>=',time.strftime('%Y-%m-%d'))], context=context)
|
||||||
|
|
||||||
if len(ids) > 1:
|
if len(ids) > 1:
|
||||||
|
|
Loading…
Reference in New Issue