diff options
| author | HDA (OpenERP) <hda@tinyerp.com> | 2010-02-01 13:59:39 +0530 |
|---|---|---|
| committer | HDA (OpenERP) <hda@tinyerp.com> | 2010-02-01 13:59:39 +0530 |
| commit | 93bd614c8e25553ae6fc7eef8eb52105c22a02e6 (patch) | |
| tree | a91657d0fbef7e2ad4c663172ce757955f20f23e /addons/document | |
| parent | a31a105e3329f55c28a5d289f152091a1bf1cc31 (diff) | |
| parent | 59ea96657ad15d170f582a80b7bf1cd80ff896f3 (diff) | |
merged to remove sql injection
bzr revid: hda@tinyerp.com-20100201082939-fj0u5f0pvlgq7j3k
Diffstat (limited to 'addons/document')
| -rw-r--r-- | addons/document/document.py | 8 |
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!')) |
