diff --git a/addons/account/installer.py b/addons/account/installer.py index 4dd01f9ec8b..03cd2787923 100644 --- a/addons/account/installer.py +++ b/addons/account/installer.py @@ -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] diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 813133385be..4f33b0c1558 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -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() diff --git a/addons/project_long_term/project_long_term.py b/addons/project_long_term/project_long_term.py index 03b8ae8edc8..e87512d0c75 100644 --- a/addons/project_long_term/project_long_term.py +++ b/addons/project_long_term/project_long_term.py @@ -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%)"),