[IMP]:improved views on task_ids,editable = bottom and phase scheduling wizard

bzr revid: rvo@tinyerp.co.in-20100304094144-8asg36h81hqqhtlb
This commit is contained in:
Rvo (Open ERP) 2010-03-04 15:11:44 +05:30
parent 4ababa7f00
commit dd2d490739
3 changed files with 55 additions and 7 deletions

View File

@ -79,8 +79,46 @@
</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>

View 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')

View File

@ -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>
@ -219,8 +220,5 @@
<field name="search_view_id" ref="view_resource_calendar_leaves_search"/>
</record>
</data>
</openerp>