[IMP] department_id added in expense,timesheet,applicant,holidays. Department view...
authorVir (Open ERP) <vir@tinyerp.com>
Wed, 17 Feb 2010 08:49:38 +0000 (14:19 +0530)
committerVir (Open ERP) <vir@tinyerp.com>
Wed, 17 Feb 2010 08:49:38 +0000 (14:19 +0530)
bzr revid: vir@tinyerp.com-20100217084938-wb9ixv8ey4ah6j9i

addons/crm_hr/crm_hr.py
addons/crm_hr/crm_hr_view.xml
addons/hr/hr_department_view.xml
addons/hr_holidays/hr.py
addons/hr_holidays/hr_view.xml
addons/hr_timesheet_sheet/hr_timesheet_sheet.py
addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
addons/resource/hr_department_view.xml

index b122cc6..2abed71 100644 (file)
@@ -26,18 +26,18 @@ class crm_job(osv.osv):
     _name = "crm.job"
     _description = "Job Cases"
     _order = "id desc"
-    _inherit ='crm.case'    
-    _columns = {        
+    _inherit ='crm.case'
+    _columns = {
             'date_closed': fields.datetime('Closed', readonly=True),
-            'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),            
+            'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
             'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.job')]"),
             'planned_revenue': fields.float('Planned Revenue'),
             'planned_cost': fields.float('Planned Costs'),
-            'probability': fields.float('Probability (%)'),     
+            'probability': fields.float('Probability (%)'),
             'partner_name': fields.char("Employee's Name", size=64),
             'partner_name2': fields.char('Employee Email', size=64),
             'partner_phone': fields.char('Phone', size=32),
-            'partner_mobile': fields.char('Mobile', size=32), 
+            'partner_mobile': fields.char('Mobile', size=32),
             'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.job')]"),
             'type_id': fields.many2one('crm.case.resource.type', 'Type Name', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.job')]"),
             'duration': fields.float('Duration'),
@@ -49,7 +49,8 @@ class crm_job(osv.osv):
             'som': fields.many2one('res.partner.som', 'State of Mind', help="The minds states allow to define a value scale which represents" \
                                                                        "the partner mentality in relation to our services.The scale has" \
                                                                        "to be created with a factor for each level from 0 (Very dissatisfied) to 10 (Extremely satisfied)."),
-            'phonecall_id':fields.many2one ('crm.phonecall', 'Phonecall'),                                                                            
+            'phonecall_id':fields.many2one ('crm.phonecall', 'Phonecall'),
+            'department_id':fields.many2one('hr.department','Department'),
     }
-   
+
 crm_job()
index 9771a25..41f3188 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <openerp>
     <data>
-    
+
     # ------------------------------------------------------
     # Job Categories
     # ------------------------------------------------------
         <field name="name">Job Categories</field>
         <field name="res_model">crm.case.categ</field>
         <field name="view_type">form</field>
-        <field name="view_id" ref="crm.crm_case_categ_tree-view"/>     
+        <field name="view_id" ref="crm.crm_case_categ_tree-view"/>
                <field name="domain">[('object_id.model', '=', 'crm.claim')]</field>
-               <field name="context">{'object_id':'crm.job'}</field>            
+               <field name="context">{'object_id':'crm.job'}</field>
     </record>
-    # ------------------------------------------------------ 
+    # ------------------------------------------------------
         # Stage
-        # ------------------------------------------------------ 
+        # ------------------------------------------------------
            <record id="crm_job_stage_act" model="ir.actions.act_window">
                <field name="name">Job Stages</field>
                <field name="res_model">crm.case.stage</field>
                <field name="view_type">form</field>
                <field name="view_id"  ref="crm.crm_case_stage_tree"/>
                        <field name="domain">[('object_id.model', '=', 'crm.claim')]</field>
-                       <field name="context">{'object_id':'crm.job'}</field>                   
+                       <field name="context">{'object_id':'crm.job'}</field>
            </record>
          <menuitem action="crm_job_stage_act" id="menu_crm_job_stage_act" parent="crm.menu_crm_case_stage"/>
     # ------------------------------------------------------
@@ -38,6 +38,7 @@
             <tree string="Jobs - Recruitment Tree"  colors="red:state=='open';black:state in ('draft', 'cancel','done','pending')">
                 <field name="id"/>
                 <field name="name" string="Description"/>
+                <field name="department_id"/>
                 <field name="partner_name" string="Name"/>
                 <field name="email_from" string="Candidate Email"/>
                 <field name="partner_phone" string="Candidate Phone"/>
@@ -48,9 +49,9 @@
                 <field name="state"/>
                 <button name="case_open" string="Open" states="draft,pending" type="object" icon="gtk-go-forward"/>
                 <button name="case_pending" string="Pending" states="draft,open" type="object" icon="gtk-media-pause"/>
-                               <button name="case_close" string="Hired" states="open,draft,pending" type="object" icon="terp-partner"/>                
+                               <button name="case_close" string="Hired" states="open,draft,pending" type="object" icon="terp-partner"/>
                 <button name="case_cancel" string="Refused" states="draft,open,pending" type="object" icon="gtk-cancel"/>
-                
+
             </tree>
         </field>
     </record>
@@ -77,7 +78,7 @@
                     <field name="phonecall_id" select="1"/>
                        <button string="Schedule a Phone Call"
                         name="%(wizard_crm_job_reschedule_phone_call)d" icon="gtk-redo" type="action"  attrs="{'invisible':[('phonecall_id','!=',False)]}"/>
-                                                                         
+                                       <field name="department_id" />
                 </group>
                 <notebook colspan="4">
                     <page string="Job Info">
                 <field name="state" group="True"/>
             </graph>
         </field>
-    </record>    
+    </record>
 
     <record id="view_crm_case_jobs_filter" model="ir.ui.view">
             <field name="name">CRM - Jobs Requests Search</field>
                                                <filter icon="terp-crm"
                                domain="[('section_id','=',context.get('section_id',False))]"
                                help="My section"
-                           />                                  
-                                       </field>                         
+                           />
+                                       </field>
                </search>
             </field>
         </record>
index f31f320..270524e 100644 (file)
        <menuitem action="open_module_tree_department" id="menu_department_def" parent="hr.menu_department_tree"/>
        <menuitem action="open_module_tree_department" id="menu_hr_department_tree" parent="menu_hr_human_resources"/>
 
+               <record model="ir.ui.view" id="view_users_form_inherit">
+            <field name="name">res.users.form</field>
+            <field name="type">form</field>
+            <field name="model">res.users</field>
+            <field name="inherit_id" ref="base.view_users_form"/>
+            <field name="arch" type="xml">
+                <notebook position="inside">
+                    <page string="Departements Informations">
+                        <separator string="Managers" colspan="4"/>
+                        <field name="parent_id" nolabel="1" colspan="4"/>
+                        <separator string="Subordinates" colspan="4"/>
+                        <field name="child_ids" nolabel="1" colspan="4"/>
+                    </page>
+                </notebook>
+            </field>
+        </record>
                <!--<record model="ir.ui.view" id="view_department_form_simple_modif_inherited1">
             <field name="name">view.department.form.hr.inherited1</field>
             <field name="model">res.users</field>
index 3d07e50..6cde1f1 100755 (executable)
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 ##################################################################################
 #
-# Copyright (c) 2005-2006 Axelor SARL. (http://www.axelor.com) 
+# Copyright (c) 2005-2006 Axelor SARL. (http://www.axelor.com)
 # and 2004-2010 Tiny SPRL (<http://tiny.be>).
 #
 # $Id: hr.py 4656 2006-11-24 09:58:42Z Cyp $
@@ -153,6 +153,8 @@ class hr_holidays(osv.osv):
         'allocation_type': fields.selection([('employee','Employee Request'),('company','Company Allocation')], 'Allocation Type', required=True, readonly=True, states={'draft':[('readonly',False)]}, help='This field is only for informative purposes, to depict if the leave request/allocation comes from an employee or from the company'),
         'parent_id': fields.many2one('hr.holidays', 'Parent'),
         'linked_request_ids': fields.one2many('hr.holidays', 'parent_id', 'Linked Requests',),
+        'holiday_user_id':fields.many2one('hr.holidays.per.user','Holiday per user'),
+        'department_id':fields.many2one('hr.department','Department'),
     }
 
     _defaults = {
@@ -192,7 +194,7 @@ class hr_holidays(osv.osv):
                     _('You can not cancel this holiday request. first You have to make its case in draft state.'))
                     else:
                         self.pool.get('crm.case').unlink(cr,uid,[record.case_id.id])
-                        
+
     def _check_date(self, cr, uid, ids):
         if ids:
             cr.execute('select number_of_days from hr_holidays where id in ('+','.join(map(str, ids))+')')
@@ -207,7 +209,7 @@ class hr_holidays(osv.osv):
         id_holiday = super(hr_holidays, self).create(cr, uid, vals, *args, **kwargs)
         self._create_holiday(cr, uid, [id_holiday])
         return id_holiday
-    
+
     def unlink(self, cr, uid, ids, context={}):
         self._update_user_holidays(cr, uid, ids)
         return super(hr_holidays, self).unlink(cr, uid, ids, context)
index 6813897..7d62ca9 100644 (file)
@@ -49,6 +49,7 @@
                             <field name="employee_id" select="1" required="1"/>
                             <field name="number_of_days_temp"/>
                             <field name="manager_id"/>
+                            <field name="department_id"/>
                             <field name="notes" colspan="4"/>
                             <newline/>
                             <field name="state" select="1" colspan="2"/>
@@ -76,6 +77,7 @@
                     <field name="name" select="1"/>
                     <field name="holiday_status_id" select="1" />
                     <field name="employee_id" select="1" required="1"/>
+                    <field name="department_id"/>
                     <field name="number_of_days_temp"/>
                     <notebook colspan="4">
                         <page string="General">
                     <field name="name" select="1"/>
                     <field name="holiday_status_id" select="1"/>
                     <field name="employee_id" select="1" />
+                    <field name="department_id"/>
                     <field name="type"/>
                     <field name="date_from" select="1" on_change="onchange_date_from(date_to, date_from)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
                     <field name="date_to" select="1" on_change="onchange_date_to(date_from, date_to)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
                 <tree string="Leaves">
                     <field name="name"/>
                     <field name="employee_id"/>
+                    <field name="department_id"/>
                     <field name="number_of_days" string="Number of Days" sum='Remaining Days'/>
                     <field name="date_from"/>
                     <field name="date_to"/>
index 81b5e99..a738ee5 100644 (file)
@@ -246,6 +246,7 @@ class hr_timesheet_sheet(osv.osv):
         'period_ids': fields.one2many('hr_timesheet_sheet.sheet.day', 'sheet_id', 'Period', readonly=True),
         'account_ids': fields.one2many('hr_timesheet_sheet.sheet.account', 'sheet_id', 'Analytic accounts', readonly=True),
         'company_id': fields.many2one('res.company', 'Company'),
+        'department_id':fields.many2one('hr.department','Department'),
     }
 
     def _default_date_from(self,cr, uid, context={}):
index e476621..ba2924f 100644 (file)
@@ -8,6 +8,7 @@
             <field name="arch" type="xml">
                 <tree string="Timesheets">
                     <field name="user_id"/>
+                    <field name="department_id"/>
                     <field name="date_from"/>
                     <field name="date_to"/>
                     <field name="name"/>
@@ -27,6 +28,7 @@
             <field name="arch" type="xml">
                 <tree string="Timesheets" editable="top">
                     <field name="user_id"/>
+                    <field name="department_id"/>
                     <field name="date_from"/>
                     <field name="date_to"/>
                     <field name="name"/>
                     <field name="date_from"/>
                     <field name="date_to"/>
                     <field name="company_id" select="1" groups="base.group_multi_company"/>
+                    <field name="department_id"/>
                     <notebook colspan="4">
                         <page string="Daily View">
                             <group col="6" colspan="4">
index fe65d98..cf4f8a7 100755 (executable)
@@ -58,7 +58,7 @@
         <menuitem action="open_module_tree_department" id="menu_department_def" parent="hr.menu_department_tree"/>
 
         <!-- res.users inherit -->
-        <record model="ir.ui.view" id="view_users_form_inherit">
+        <!--<record model="ir.ui.view" id="view_users_form_inherit">
             <field name="name">res.users.form</field>
             <field name="type">form</field>
             <field name="model">res.users</field>
@@ -75,5 +75,5 @@
             </field>
         </record>
 
-    </data>
+    --></data>
 </openerp>