[Erp5-report] r28975 - /erp5/trunk/products/ERP5/Document/File.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Sep 11 16:27:31 CEST 2009


Author: nicolas
Date: Fri Sep 11 16:27:30 2009
New Revision: 28975

URL: http://svn.erp5.org?rev=28975&view=rev
Log:
Set filename on document before upload file

Modified:
    erp5/trunk/products/ERP5/Document/File.py

Modified: erp5/trunk/products/ERP5/Document/File.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/File.py?rev=28975&r1=28974&r2=28975&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/File.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/File.py [utf8] Fri Sep 11 16:27:30 2009
@@ -110,14 +110,14 @@
     if kw.has_key('file'):
       file = kw.get('file')
       precondition = kw.get('precondition')
-      if self._isNotEmpty(file):
-        self._setFile(file, precondition=precondition)
       if set_filename__:
         filename = getattr(file, 'filename', None)
         # if file field is empty(no file is uploaded),
         # filename is empty string.
         if filename not in (None, ''):
-          kw['source_reference'] = filename
+          self._setSourceReference(filename)
+      if self._isNotEmpty(file):
+        self._setFile(file, precondition=precondition)
       del kw['file']
     Base._edit(self, **kw)
 




More information about the Erp5-report mailing list