From 54f4c8f1cce2e4d2639131964d978253e526b924 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 27 Oct 2008 11:46:50 +0100 Subject: [PATCH] bugfix bzr revid: fp@tinyerp.com-20081027104650-1c3tf9xsx0rmmoat --- bin/osv/orm.py | 5 ++++- bin/tools/misc.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index f65c9183b20..37cc2e50abe 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -1404,7 +1404,10 @@ class orm(orm_template): for key,val in res.items(): if f._multi: val = val[k] - cr.execute("UPDATE \"%s\" SET \"%s\"='%s' where id=%d"% (self._table, k, val, key)) + if (val<>False) or (type(val)<>bool): + cr.execute("UPDATE \"%s\" SET \"%s\"='%s' where id=%d"% (self._table, k, val, key)) + #else: + # cr.execute("UPDATE \"%s\" SET \"%s\"=NULL where id=%d"% (self._table, k, key)) # and add constraints if needed if isinstance(f, fields.many2one): diff --git a/bin/tools/misc.py b/bin/tools/misc.py index 509c04ec5e8..9e292c9e27a 100644 --- a/bin/tools/misc.py +++ b/bin/tools/misc.py @@ -396,7 +396,7 @@ def email_send_attach(email_from, email_to, subject, body, email_cc=None, email_ msg = MIMEMultipart() if not ssl: - ssl = config['smtp_ssl'] + ssl = config.get('smtp_ssl', False) msg['Subject'] = Header(subject.decode('utf8'), 'utf-8') msg['From'] = email_from