Browse Source

[REF] Flake8

pull/85/head
Sylvain LE GAL 10 years ago
parent
commit
1c80e0c395
  1. 9
      document_extract_from_database/__openerp__.py
  2. 11
      document_extract_from_database/attachment.py

9
document_extract_from_database/__openerp__.py

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
#################################################################################
###############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012 Julius Network Solutions SARL <contact@julius.fr>
@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#################################################################################
###############################################################################
{
"name": "Extract Documents from database",
@ -32,7 +32,8 @@
"description": """
Button to extract documents from your database
==============================================
If you want to extract the document stored in your database this module is for you.
If you want to extract the document stored in your database this module is for
you.
Make sure you've correctly defined the filestore in your database:
"Settings > Parameters > System Parameters", add for example:
@ -49,5 +50,3 @@ Then, "More > Document Extraction"
'installable': True,
'active': False,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

11
document_extract_from_database/attachment.py

@ -19,21 +19,24 @@
#
###############################################################################
from openerp.osv import orm, fields
from openerp.osv import orm
import base64
class document_multiple_action(orm.TransientModel):
_name = "document.multiple.action"
_description = "Multiple action on document"
def write_again(self, cr, uid, ids, context=None):
if context is None: context = {}
if context is None:
context = {}
document_obj = self.pool.get('ir.attachment')
document_ids = context.get('active_ids')
if document_ids:
document_obj.write_again(cr, uid, document_ids, context=context)
return True
class document_file(orm.Model):
_inherit = 'ir.attachment'
@ -50,10 +53,8 @@ class document_file(orm.Model):
return True
def write_again(self, cr, uid, ids, context=None):
if context==None:
if context is None:
context = {}
for document_id in ids:
self._write_again(cr, uid, document_id, context=context)
return True
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
Loading…
Cancel
Save