diff --git a/addons/analytic/project.py b/addons/analytic/project.py index 1f24a99d235..e9558f7a101 100644 --- a/addons/analytic/project.py +++ b/addons/analytic/project.py @@ -255,7 +255,7 @@ class account_analytic_account(osv.osv): if not parent_id: return {} parent = self.read(cr, uid, [parent_id], ['partner_id','code'])[0] - childs = self.search(cr, uid, [('parent_id', '=', parent_id), ('active', 'in', [True, False])]) + childs = self.search(cr, uid, [('parent_id', '=', parent_id)]) numchild = len(childs) if parent['partner_id']: partner = parent['partner_id'][0] diff --git a/addons/document/document.py b/addons/document/document.py index 824607fa2e8..375f24cd62a 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -77,7 +77,7 @@ class document_file(osv.osv): # the directory id now is mandatory. It can still be computed automatically. 'parent_id': fields.many2one('document.directory', 'Directory', select=1, required=True), 'file_size': fields.integer('File Size', required=True), - 'file_type': fields.char('Content Type', size=32), + 'file_type': fields.char('Content Type', size=64), # If ir.attachment contained any data before document is installed, preserve # the data, don't drop the column! 'db_datas': fields.binary('Data', oldname='datas'), @@ -141,6 +141,8 @@ class document_file(osv.osv): return super(document_file, self).copy(cr, uid, id, default, context) def write(self, cr, uid, ids, vals, context=None): + if not isinstance(ids, list): + ids = [ids] res = self.search(cr, uid, [('id', 'in', ids)]) if not len(res): return False diff --git a/addons/document/document_directory.py b/addons/document/document_directory.py index bcb86d589d2..17c3dfb66d9 100644 --- a/addons/document/document_directory.py +++ b/addons/document/document_directory.py @@ -65,14 +65,14 @@ class document_directory(osv.osv): objid=self.pool.get('ir.model.data') try: mid = objid._get_id(cr, uid, 'document', 'dir_root') - return None # TODO: check why not display root dir + return False # TODO: check why not display root dir if not mid: - return None + return False except Exception, e: import netsvc logger = netsvc.Logger() logger.notifyChannel("document", netsvc.LOG_WARNING, 'Cannot set directory root:'+ str(e)) - return None + return False return objid.browse(cr, uid, mid, context=context).res_id def _get_def_storage(self,cr,uid,context=None): diff --git a/addons/document/std_index.py b/addons/document/std_index.py index bd61c65e16b..1f639a32fa3 100644 --- a/addons/document/std_index.py +++ b/addons/document/std_index.py @@ -23,7 +23,7 @@ import StringIO import odt2txt from content_index import indexer, cntIndex - +from subprocess import Popen, PIPE def _to_unicode(s): try: