[IMP]:improved views on task_ids,editable = bottom and phase scheduling wizard
authorRvo (Open ERP) <rvo@tinyerp.co.in>
Thu, 4 Mar 2010 09:41:44 +0000 (15:11 +0530)
committerRvo (Open ERP) <rvo@tinyerp.co.in>
Thu, 4 Mar 2010 09:41:44 +0000 (15:11 +0530)
bzr revid: rvo@tinyerp.co.in-20100304094144-8asg36h81hqqhtlb

addons/project_long_term/project_view.xml
addons/project_long_term/wizard/compute_phases_date.py
addons/resource/resource_view.xml

index d8f6cfe..7d0d0e3 100644 (file)
                         </page>
                         <page string="Task Detail">
                             <separator colspan="4" string="Project's Tasks"/>
-                            <field colspan="4" name="task_ids" nolabel="1"/>
-
+                            <field colspan="4" name="task_ids" context="{'default_project_id' :project_id}" nolabel="1">
+                                <tree editable="bottom" string="Project's Tasks">
+                                    <field name="name"/>
+                                    <field name="project_id"/>
+                                    <field name="user_id"/>
+                                               <field name="date_start"/>
+                                       <field name="date_deadline"/>
+                                       <field name="planned_hours" widget="float_time" on_change="onchange_planned(project_id, user_id, planned_hours, effective_hours)"/>
+                                                                       <field name="remaining_hours" widget="float_time" sum="Remaining Hours"/>
+                                                                       <field name="effective_hours" invisible="1"/>
+                                                                       <field name="state"/>
+                                                                       <field name="occupation_rate" invisible="1"/>
+                                  </tree>
+                                  <form string="Project's Tasks">
+                                       <notebook colspan="4">
+                                               <page string="Task Detail">
+                                                       <group colspan="4" col="4">
+                                                       <field name="name"/>
+                                                       <field name="project_id"/>
+                                                       <field name="user_id"/>
+                                                   </group>
+                                                               <group colspan="2" col="2">
+                                                               <separator string="Dates" colspan="2"/>
+                                                               <field name="date_start"/>
+                                                               <field name="date_deadline"/>
+                                                               <field name="occupation_rate" invisible="1"/>
+                                                   </group>
+                                                   <group colspan="2" col="2">
+                                                               <separator string="Planning" colspan="2"/>
+                                                               <field name="planned_hours" widget="float_time" on_change="onchange_planned(project_id, user_id, planned_hours, effective_hours)"/>
+                                                                                               <field name="remaining_hours" widget="float_time" sum="Remaining Hours"/>
+                                                                                               <field name="effective_hours" invisible="1"/>
+                                                   </group>
+                                                   <group colspan="6" col="4">
+                                                                                               <field name="state"/>
+                                                                                       </group>
+                                                                               </page>
+                                                                       </notebook>
+                                  </form>
+                             </field>
                                <button name="%(wizard_schedule_task)d" string="Schedule Tasks" type="action" icon="gtk-jump-to"/>
                         </page>
                     </notebook>
index 0ad554f..54051b5 100644 (file)
@@ -128,6 +128,17 @@ class wizard_compute_phases(wizard.interface):
             phase_schedule(cr, uid, phase, start_dt, calendar_id or False)
         return {}
 
+    def phases_open_list(self, cr, uid, data, context):
+        mod_obj = pooler.get_pool(cr.dbname).get('ir.model.data')
+        act_obj = pooler.get_pool(cr.dbname).get('ir.actions.act_window')
+        result = mod_obj._get_id(cr, uid, 'project_long_term', 'act_project_phase')
+        id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
+        result = act_obj.read(cr, uid, [id], context=context)[0]
+        if data['form']['project_id']:
+            result['domain'] = [('project_id', '=', data['form']['project_id'])]
+        result['domain'] = [('state', 'not in', ['cancelled','done'])]
+        return result
+
     states = {
         'init': {
             'actions': [],
@@ -139,9 +150,10 @@ class wizard_compute_phases(wizard.interface):
         },
         'compute': {
             'actions': [_compute_date],
-            'result': {'type':'form','arch':success_msg,'fields':{}, 'state':[('end', 'Ok')]},
-        }
+            'result': {'type': 'action', 'action':phases_open_list, 'state':'end'},
+        },
     }
+
 wizard_compute_phases('wizard.compute.phases')
 
 
index c3092cb..97cdfdc 100755 (executable)
@@ -52,6 +52,7 @@
                </search>
             </field>
         </record>
+     
         <record id="resource_calendar_form" model="ir.ui.view">
             <field name="name">resource.calendar.form</field>
             <field name="model">resource.calendar</field>
             <field name="search_view_id" ref="view_resource_calendar_leaves_search"/>
         </record>
 
-
-
-
     </data>
 </openerp>