Improved project management
bzr revid: hda@tinyerp.com-20100201111044-i2b578hk7ctij5gc
This commit is contained in:
parent
b4d7610933
commit
56553f6b79
|
@ -242,16 +242,17 @@ class task(osv.osv):
|
|||
result = {}
|
||||
for res in self.browse(cr, uid, ids):
|
||||
if date_start and planned:
|
||||
print date_start, planned, occupation_rate
|
||||
resource_id = self.pool.get('resource.resource').search(cr,uid,[('user_id','=',res.user_id.id)])
|
||||
resource_obj = self.pool.get('resource.resource').browse(cr,uid,resource_id)[0]
|
||||
d = mx.DateTime.strptime(date_start,'%Y-%m-%d %H:%M:%S')
|
||||
hrs = (planned)/(occupation_rate)
|
||||
work_times = self.pool.get('resource.calendar').interval_get(cr, uid, resource_obj.calendar_id.id or False, d, hrs or 0.0, resource_obj.id)
|
||||
result['date_end'] = work_times[-1][1].strftime('%Y-%m-%d %H:%M:%S')
|
||||
result['remaining_hours'] = planned-effective
|
||||
if resource_id:
|
||||
resource_obj = self.pool.get('resource.resource').browse(cr,uid,resource_id)[0]
|
||||
d = mx.DateTime.strptime(date_start,'%Y-%m-%d %H:%M:%S')
|
||||
hrs = (planned)/(occupation_rate)
|
||||
work_times = self.pool.get('resource.calendar').interval_get(cr, uid, resource_obj.calendar_id.id or False, d, hrs or 0.0, resource_obj.id)
|
||||
result['date_end'] = work_times[-1][1].strftime('%Y-%m-%d %H:%M:%S')
|
||||
result['remaining_hours'] = planned-effective
|
||||
return {'value':result}
|
||||
|
||||
|
||||
def _default_project(self, cr, uid, context={}):
|
||||
if 'project_id' in context and context['project_id']:
|
||||
return context['project_id']
|
||||
|
|
|
@ -334,6 +334,7 @@
|
|||
<separator string="Dates" colspan="2"/>
|
||||
<field name="date_start"/>
|
||||
<field name="date_end"/>
|
||||
<field name="occupation_rate"/>
|
||||
</group>
|
||||
<separator string="Miscelleanous" colspan="4"/>
|
||||
<field name="partner_id" select="2"/>
|
||||
|
@ -481,7 +482,7 @@
|
|||
<filter domain="[('manager_id','=',False)]" help="Unassigned Project" icon="terp-project"/>
|
||||
</field>
|
||||
<field name="user_id" select="1" widget="selection">
|
||||
<filter domain="[('user_id','=',uid)]" help="My Tasks" icon="gtk-execute" default="1"/>
|
||||
<filter domain="[('user_id','=',uid)]" help="My Tasks" icon="gtk-execute"/>
|
||||
<filter domain="[('user_id','=',False)]" help="Unassigned Tasks" icon="gtk-execute" separator="1"/>
|
||||
</field>
|
||||
</group>
|
||||
|
|
Loading…
Reference in New Issue