[MERGE] Merge psi branch : lp:~psi-tinyerp/openobject-addons/trunk-mode3-yaml:

-Improve resource calendar leave form view
 -put selection box for working time
 -search View : set user_id from project phase by deafult
 -date_deadline should not use to compute effectivity. should use date_end

bzr revid: mra@tinyerp.com-20100514095039-5fsaxmmftl64wmk9
This commit is contained in:
mra (Open ERP)
2010-05-14 15:20:39 +05:30
8 changed files with 27 additions and 29 deletions
@@ -85,8 +85,8 @@ class project_phase(osv.osv):
_columns = {
'name': fields.char("Phase Name", size=64, required=True),
'date_start': fields.datetime('Starting Date'),
'date_end': fields.datetime('End Date'),
'date_start': fields.datetime('Starting Date', help="Start date of the phase"),
'date_end': fields.datetime('End Date', help="End date of the phase"),
'constraint_date_start': fields.datetime('Start Date', help='force the phase to start after this date'),
'constraint_date_end': fields.datetime('End Date', help='force the phase to finish before this date'),
'project_id': fields.many2one('project.project', 'Project', required=True),
@@ -104,8 +104,8 @@ class project_phase(osv.osv):
}
_defaults = {
'responsible_id': lambda obj,cr,uid,context: uid,
'state': lambda *a: 'draft',
'sequence': lambda *a: 10,
'state': 'draft',
'sequence': 10,
}
_order = "name"
_constraints = [
@@ -237,7 +237,7 @@ class project_resource_allocation(osv.osv):
'useability': fields.float('Useability', help="Useability of this ressource for this project phase in percentage (=50%)"),
}
_defaults = {
'useability': lambda *a: 100,
'useability': 100,
}
project_resource_allocation()
@@ -261,7 +261,7 @@ class task(osv.osv):
'planned_hours': fields.float('Planned Hours', required=True, help='Estimated time to do the task, usually set by the project manager when the task is in draft state.'),
}
_defaults = {
'occupation_rate':lambda *a: '1'
'occupation_rate': '1'
}
def onchange_planned(self, cr, uid, ids, project, user_id=False, planned=0.0, effective=0.0, date_start=None, occupation_rate=0.0):
@@ -368,4 +368,4 @@ class task(osv.osv):
return super(task, self).write(cr, uid, ids, vals, context=context)
task()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -204,9 +204,7 @@
<field name="project_id" widget="selection">
<filter domain="[('project_id.user_id','=',uid)]" help="My Projects" icon="terp-project"/>
</field>
<field name="responsible_id" widget="selection">
<filter domain="[('responsible_id','=',uid)]" help="My Phase" icon="gtk-execute" default="1"/>
</field>
<field name="responsible_id" widget="selection"/>
<field name="date_start"/>
</group>
<newline/>
@@ -225,6 +223,7 @@
<field name="res_model">project.phase</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calendar,gantt</field>
<field name="context">{'search_default_responsible_id':uid}</field>
<field name="search_view_id" ref="view_project_phase_search"/>
</record>
@@ -48,7 +48,6 @@ class project_compute_phases(osv.osv_memory):
return self.compute_date(cr, uid, ids, context=context)
def _phase_schedule(self, cr, uid, phase, start_date, calendar_id=False, context=None):
"""Schedule phase with the start date till all the next phases are completed.
Arguements: start_dsate -- start date for the phase
@@ -132,7 +132,7 @@ class project_compute_tasks(osv.osv_memory):
ctx.update({'scheduler': True})
user_id = user_obj.search(cr, uid, [('name', '=', t.booked_resource[0].__name__)])
task_pool.write(cr, uid, [tasks[loop_no-1].id], {'date_start': s_date.strftime('%Y-%m-%d %H:%M:%S'),
'date_deadline': e_date.strftime('%Y-%m-%d %H:%M:%S'),
'date_end': e_date.strftime('%Y-%m-%d %H:%M:%S'),
'user_id': user_id[0]},
context=ctx)
loop_no +=1
@@ -65,7 +65,7 @@ class project_schedule_task(osv.osv_memory):
{'__doc__': res.user_id.name,
'__name__': res.user_id.name,
'vacation': tuple(leaves),
'efficiency': resource_eff
'efficiency': resource_eff,
}))
return resource_objs
@@ -149,7 +149,7 @@ class project_schedule_task(osv.osv_memory):
ctx.update({'scheduler': True})
user_id = user_obj.search(cr, uid, [('name', '=', t.booked_resource[0].__name__)])
task_obj.write(cr, uid, [tasks[loop_no-1].id], {'date_start': s_date.strftime('%Y-%m-%d %H:%M:%S'),
'date_deadline': e_date.strftime('%Y-%m-%d %H:%M:%S'),
'date_end': e_date.strftime('%Y-%m-%d %H:%M:%S'),
'user_id': user_id[0]},
context=ctx)
loop_no +=1