[FIX] project_long_term : _compute() method corrected and view of project phase corrected.

lp bug: https://launchpad.net/bugs/655316 fixed

bzr revid: ach@tinyerp.com-20101006111247-53h19u0qw8z97u4u
This commit is contained in:
Vianney,Anup(OpenERP)
2010-10-06 16:42:47 +05:30
committed by Anup (OpenERP)
parent 551862ccc6
commit 622e39465b
2 changed files with 15 additions and 16 deletions
@@ -92,7 +92,7 @@ class project_phase(osv.osv):
model_data_id = model_data_obj._get_id(cr, uid, 'product', 'uom_hour')
return model_data_obj.read(cr, uid, [model_data_id], ['res_id'])[0]['res_id']
def _compute(self, cr, uid, ids, context=None):
def _compute(self, cr, uid, ids,field_name, arg, context=None):
res = {}
if not ids:
return res
@@ -100,9 +100,7 @@ class project_phase(osv.osv):
tot = 0.0
for task in phase.task_ids:
tot += task.planned_hours
res[phase.id] = {
'total_hours' : tot
}
res[phase.id] = tot
return res
_columns = {
@@ -110,22 +110,23 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Project Phase">
<group colspan="6" col="6">
<group colspan="2" col="2">
<group colspan="8" col="7">
<group colspan="8">
<field name="name" select="1"/>
<field name="date_start"/>
<field name="total_hours"/>
<field name="project_id" on_change="onchange_project(project_id)" colspan="2"/>
<field name="responsible_id" colspan="2"/>
</group>
<group colspan="2" col="4">
<field name="project_id" on_change="onchange_project(project_id)" colspan="4"/>
<newline/>
<field name="duration" colspan="1" on_change="onchange_days(project_id)" />
<newline/>
<group colspan="2">
<field name="date_start"/>
<field name="date_end"/>
</group>
<group colspan="2">
<field name="duration" on_change="onchange_days(project_id)"/>
<field name="product_uom" nolabel="1" domain="[('category_id.name', '=', 'Working Time')]"/>
</group>
<group colspan="2" col="2">
<field name="responsible_id"/>
<field name="date_end"/>
</group>
</group>
</group>
<notebook colspan="4">
<page string="Resource Allocation">
<field colspan="4" name="resource_ids" nolabel="1">