[IMP] (task id=740) changes according to technical meeting review
bzr revid: psi@tinyerp.co.in-20100514091502-ln2doe2ev1h70q58
This commit is contained in:
parent
8ad17345ba
commit
22e38ea30b
|
@ -349,7 +349,7 @@
|
|||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="resource.resource_calendar_leave_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="resource_id" on_change="onchange_resource(resource_id)" position="after">
|
||||
<field name="date_to" position="after">
|
||||
<field name="holiday_id"/>
|
||||
</field>
|
||||
</field>
|
||||
|
|
|
@ -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:
|
|
@ -225,6 +225,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
|
||||
|
|
|
@ -30,7 +30,7 @@ class resource_calendar(osv.osv):
|
|||
_description = "Resource Calendar"
|
||||
_columns = {
|
||||
'name' : fields.char("Name", size=64, required=True),
|
||||
'company_id' : fields.many2one('res.company', 'Company', required=True),
|
||||
'company_id' : fields.many2one('res.company', 'Company', required=False),
|
||||
'week_id' : fields.one2many('resource.calendar.week', 'calendar_id', 'Working Time'),
|
||||
'manager' : fields.many2one('res.users', 'Workgroup manager'),
|
||||
}
|
||||
|
@ -158,10 +158,10 @@ class resource_resource(osv.osv):
|
|||
'calendar_id' : fields.many2one("resource.calendar", "Working time", help="Define the schedule of resource"),
|
||||
}
|
||||
_defaults = {
|
||||
'resource_type' : lambda *a: 'user',
|
||||
'time_efficiency' : lambda *a: 1,
|
||||
'active' : lambda *a: True,
|
||||
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'resource.resource', c)
|
||||
'resource_type' : 'user',
|
||||
'time_efficiency' : 1,
|
||||
'active' : True,
|
||||
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'resource.resource', c)
|
||||
}
|
||||
|
||||
def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
|
||||
|
|
|
@ -165,7 +165,7 @@
|
|||
<field name="name" />
|
||||
<field name="active"/>
|
||||
<field name="company_id" widget="selection"/>
|
||||
<field name="calendar_id" />
|
||||
<field name="calendar_id" widget="selection"/>
|
||||
<field name="resource_type" />
|
||||
<field name="user_id" attrs="{'required':[('resource_type','=','user')]}"/>
|
||||
<field name="time_efficiency" />
|
||||
|
@ -200,13 +200,13 @@
|
|||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Leave Detail">
|
||||
<field name="name" />
|
||||
<field name="name"/>
|
||||
<field name="company_id" widget="selection"/>
|
||||
<field name="calendar_id" />
|
||||
<newline/>
|
||||
<field name="date_from" />
|
||||
<field name="date_to" />
|
||||
<field name="calendar_id"/>
|
||||
<field name="resource_id" on_change="onchange_resource(resource_id)"/>
|
||||
<newline/>
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -217,7 +217,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<tree string="Leave Detail">
|
||||
<field name="name" />
|
||||
<field name="company_id" />
|
||||
<field name="company_id"/>
|
||||
<field name="calendar_id" />
|
||||
<field name="date_from" />
|
||||
<field name="date_to" />
|
||||
|
|
Loading…
Reference in New Issue