[FIX] HR useability improvements
authorFabien Pinckaers <fp@openerp.com>
Wed, 10 Oct 2012 19:29:27 +0000 (21:29 +0200)
committerFabien Pinckaers <fp@openerp.com>
Wed, 10 Oct 2012 19:29:27 +0000 (21:29 +0200)
bzr revid: fp@openerp.com-20121010192927-6ud5e3zvhp5gabip

1  2 
addons/hr/hr_view.xml
addons/hr_expense/security/ir.model.access.csv
addons/hr_holidays/hr_holidays_view.xml
addons/hr_recruitment/hr_recruitment_view.xml
addons/hr_timesheet_invoice/hr_timesheet_invoice.py

                          <field name="state" widget="statusbar" statusbar_visible="recruit,open"/>
                      </header>
                      <sheet>
-                         <label for="name" class="oe_edit_only"/>
-                         <h1>
-                             <field name="name" class="oe_inline"/>
-                             <label class="oe_inline" string="(" attrs="{'invisible': [('department_id', '=', False)]}"/>
-                             <field name="department_id" class="oe_inline"/>
-                             <label class="oe_inline" string=")" attrs="{'invisible': [('department_id', '=', False)]}"/>
-                         </h1>
+                         <div class="oe_title">
+                             <label for="name" class="oe_edit_only"/>
+                             <h1><field name="name" class="oe_inline"/></h1>
+                         </div>
 -                        <div name="Department">
 -                            <label for="department_id" class="oe_edit_only"/>
 -                            <h1>
 -                                <label class="oe_inline" string="(" attrs="{'invisible': [('department_id', '=', False)]}"/>
 -                                <field name="department_id" class="oe_inline"/>
 -                                <label class="oe_inline" string=")" attrs="{'invisible': [('department_id', '=', False)]}"/>
 -                            </h1>
 -                        </div>
                          <group>
                              <group>
                                  <field name="no_of_employee" groups="base.group_user"/>
                              </group>
                              <group>
                                  <field name="company_id" widget="selection" groups="base.group_multi_company"/>
--                            </group>
++                                <field name="department_id"/>                            </group>
                          </group>
                          <div>
                              <label for="description"/>
@@@ -9,6 -9,7 +9,7 @@@ access_product_template_hr_expense_user
  access_product_uom_hr_expense_user,product.uom.hr.expense.user,product.model_product_uom,base.group_hr_user,1,1,1,1\r
  access_product_price_type_user,product.price.type.user,product.model_product_price_type,base.group_hr_user,1,1,1,1\r
  access_account_journal_user,account.journal.user,account.model_account_journal,base.group_hr_user,1,1,1,1\r
 -access_account_journal_employee,account.journal.employee,account.model_account_journal,base.group_user,1,1,1,1\r
++access_account_journal_employee,account.journal.employee,account.model_account_journal,base.group_user,1,0,0,0\r
  access_account_invoice_user,account.invoice.user,account.model_account_invoice,base.group_hr_user,1,1,1,1\r
  access_account_invoice_line_user,account.invoice.line.user,account.model_account_invoice_line,base.group_hr_user,1,1,1,1\r
  access_account_analytic_journal_user,account.ianalytic.journal.user,account.model_account_analytic_journal,base.group_hr_user,1,1,1,1\r
  
          <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 Approve</field>
++            <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 name="Allocation Requests to Approve" parent="menu_open_ask_holidays" id="menu_request_approve_allocation" action="request_approve_allocation" groups="base.group_hr_manager"/>
++        <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">
              <field name="name">Leaves Summary</field>
              <field name="res_model">hr.holidays</field>
                          attrs="{'invisible':[('survey_id','=',False)]}"/>
                  </div>
              </field>
-             <xpath expr="/form/sheet/h1" version="7.0" position="after">
-                 <div colspan="4" attrs="{'invisible': [('alias_domain', '=', False)]}">
 -            <xpath expr="//div[@name='Department']" version="7.0" position="after">
 -                <div colspan="4" attrs="{'invisible': [('alias_domain', '=', False)]}">
++            <xpath expr="//div[@class='oe_title']" version="7.0" position="after">
++                <div attrs="{'invisible': [('alias_domain', '=', False)]}">
                      <field name="alias_id" invisible="1" required="0"/>
                      <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"/>
@@@ -135,6 -135,8 +135,8 @@@ class account_analytic_line(osv.osv)
      def _default_general_account(self, cr, uid, context=None):
          proxy = self.pool.get('hr.employee')
          record_ids = proxy.search(cr, uid, [('user_id', '=', uid)], context=context)
+         if not record_ids:
 -            raise osv.except_osv(_('Error!'), _('Please create an employee and associate it with this user.'))
++            raise osv.except_osv(_('Error!'), _('Please create an employee associated to this user.'))
          employee = proxy.browse(cr, uid, record_ids[0], context=context)
          if employee.product_id and employee.product_id.property_account_income:
              return employee.product_id.property_account_income.id