fixed bug : unicode problem on display path
bzr revid: hmo-tinyerp-20081216123515-qh0zve76cto3mqsy
This commit is contained in:
parent
16b95805c4
commit
4566b4174e
|
@ -37,6 +37,7 @@ import random
|
|||
import string
|
||||
from psycopg2 import Binary
|
||||
from tools import config
|
||||
import tools
|
||||
|
||||
def random_name():
|
||||
random.seed()
|
||||
|
@ -497,6 +498,9 @@ class document_file(osv.osv):
|
|||
result[id]=''
|
||||
else:
|
||||
result[id] = ''
|
||||
if context.get('bin_size', False):
|
||||
result[id] = tools.human_size(len(result[id]))
|
||||
|
||||
return result
|
||||
|
||||
#
|
||||
|
@ -539,7 +543,7 @@ class document_file(osv.osv):
|
|||
'create_date': fields.datetime('Date Created', readonly=True),
|
||||
'create_uid': fields.many2one('res.users', 'Creator', readonly=True),
|
||||
'store_method': fields.selection([('db','Database'),('fs','Filesystem'),('link','Link')], "Storing Method"),
|
||||
'datas': fields.function(_data_get,method=True,store=True,fnct_inv=_data_set,string='File Content',type="binary"),
|
||||
'datas': fields.function(_data_get,method=True,fnct_inv=_data_set,string='File Content',type="binary"),
|
||||
'store_fname': fields.char('Stored Filename', size=200),
|
||||
'res_model': fields.char('Attached Model', size=64), #res_model
|
||||
'res_id': fields.integer('Attached ID'), #res_id
|
||||
|
|
|
@ -74,7 +74,7 @@ class abstracted_fs:
|
|||
|
||||
# Ok
|
||||
def db_list(self):
|
||||
return pooler.pool_dic.keys()
|
||||
#return pooler.pool_dic.keys()
|
||||
s = netsvc.LocalService('db')
|
||||
result = s.list()
|
||||
self.db_name_list = []
|
||||
|
@ -95,8 +95,7 @@ class abstracted_fs:
|
|||
if cr is not None:
|
||||
cr.close()
|
||||
#if db is not None:
|
||||
# pooler.close_db(db_name)
|
||||
print 'Return', self.db_name_list
|
||||
# pooler.close_db(db_name)
|
||||
return self.db_name_list
|
||||
|
||||
# Ok
|
||||
|
@ -689,7 +688,7 @@ class abstracted_fs:
|
|||
|
||||
# formatting is matched with proftpd ls output
|
||||
yield "%s %3s %-8s %-8s %8s %s %s\r\n" %(perms, nlinks, uname, gname,
|
||||
size, mtime, file.path.split('/')[-1])
|
||||
size, mtime, file.path.encode('ascii','replace').split('/')[-1])
|
||||
|
||||
# Ok
|
||||
def format_mlsx(self, basedir, listing, perms, facts, ignore_err=True):
|
||||
|
|
Loading…
Reference in New Issue