bzr revid: fp@tinyerp.com-20110819152303-ohbyea95j6e2lxsk
This commit is contained in:
Fabien Pinckaers
2011-08-19 17:23:03 +02:00
2 changed files with 7 additions and 5 deletions
+5 -5
View File
@@ -36,13 +36,13 @@ def get_plain_ftp(timeout=10.0):
def get_ftp_login(cr, uid, ormobj):
ftp = get_plain_ftp()
user = ormobj.pool.get('res.users').read(cr, uid, uid)
passwd = user.get('password','')
user = ormobj.pool.get('res.users').browse(cr, uid, uid)
passwd = user.password or ''
if passwd.startswith("$1$"):
# md5 by base crypt. We cannot decode, wild guess
# md5 by base crypt. We cannot decode, wild guess
# that passwd = login
passwd = user.get('login', '')
ftp.login(user.get('login',''), passwd)
passwd = user.login
ftp.login(user.login, passwd)
ftp.cwd("/" + cr.dbname)
return ftp
+2
View File
@@ -180,6 +180,8 @@ class account_invoice(osv.osv):
return super(account_invoice, self).create(cr, uid, vals, context=context)
def write(self, cr, uid, ids, vals, context={}):
if isinstance(ids, (int, long)):
ids = [ids]
for inv in self.browse(cr, uid, ids, context):
if vals.has_key('reference_type'):
reference_type = vals['reference_type']