[MERGE] a few project management-related minor fixes
bzr revid: odo@openerp.com-20100730122712-vn8biovwd8w1bull
This commit is contained in:
commit
48bf89dc34
|
@ -298,8 +298,8 @@ class account_installer(osv.osv_memory):
|
|||
|
||||
# Creating Journals Sales and Purchase
|
||||
vals_journal={}
|
||||
data_id = data_pool.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_sp_journal_view')])
|
||||
data = data_pool.browse(cr, uid, data_id[0])
|
||||
data_id = mod_obj.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_sp_journal_view')])
|
||||
data = mod_obj.browse(cr, uid, data_id[0])
|
||||
view_id = data.res_id
|
||||
|
||||
seq_id = obj_sequence.search(cr,uid,[('name','=','Account Journal')])[0]
|
||||
|
|
|
@ -60,7 +60,8 @@ class mrp_workcenter(osv.osv):
|
|||
'resource_id': fields.many2one('resource.resource','Resource',ondelete='cascade'),
|
||||
}
|
||||
_defaults = {
|
||||
'capacity_per_cycle': lambda *a: 1.0,
|
||||
'capacity_per_cycle': 1.0,
|
||||
'resource_type': 'material',
|
||||
}
|
||||
mrp_workcenter()
|
||||
|
||||
|
|
|
@ -190,6 +190,8 @@ class project_phase(osv.osv):
|
|||
return super(project_phase, self).write(cr, uid, ids, vals, context=context)
|
||||
# Consider calendar and efficiency if the phase is performed by a resource
|
||||
# otherwise consider the project's working calendar
|
||||
if type(ids) == int:
|
||||
ids = [ids]
|
||||
phase = self.browse(cr, uid, ids[0], context=context)
|
||||
calendar_id = phase.project_id.resource_calendar_id and phase.project_id.resource_calendar_id.id or False
|
||||
resource_id = resource_obj.search(cr, uid, [('user_id', '=', phase.responsible_id.id)],context=context)
|
||||
|
@ -246,7 +248,7 @@ class project_resource_allocation(osv.osv):
|
|||
_rec_name = 'resource_id'
|
||||
_columns = {
|
||||
'resource_id': fields.many2one('resource.resource', 'Resource', required=True),
|
||||
'phase_id': fields.many2one('project.phase', 'Project Phase', required=True),
|
||||
'phase_id': fields.many2one('project.phase', 'Project Phase', ondelete='cascade', required=True),
|
||||
'phase_id_date_start': fields.related('phase_id', 'date_start', type='date', string='Starting Date of the phase'),
|
||||
'phase_id_date_end': fields.related('phase_id', 'date_end', type='date', string='Ending Date of the phase'),
|
||||
'useability': fields.float('Usability', help="Usability of this resource for this project phase in percentage (=50%)"),
|
||||
|
|
Loading…
Reference in New Issue