summaryrefslogtreecommitdiff
path: root/addons/document/document.py
diff options
context:
space:
mode:
Diffstat (limited to 'addons/document/document.py')
-rw-r--r--addons/document/document.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/addons/document/document.py b/addons/document/document.py
index c8308265e4d..5613cc55958 100644
--- a/addons/document/document.py
+++ b/addons/document/document.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,7 +15,7 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@@ -36,6 +36,7 @@ import tools
from tools.translate import _
import nodes
+
class document_file(osv.osv):
_inherit = 'ir.attachment'
_rec_name = 'datas_fname'
@@ -185,7 +186,8 @@ class document_file(osv.osv):
import urllib
datas=base64.encodestring(urllib.urlopen(vals['link']).read())
else:
- datas=vals.get('datas',False)
+ datas = vals.get('datas',False)
+
vals['file_size']= datas and len(datas) or 0
if not self._check_duplication(cr,uid,vals):
raise osv.except_osv(_('ValidateError'), _('File name must be unique!'))