From 1c80e0c39512e32ee2fe78c870906a756e0249b5 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Wed, 19 Nov 2014 18:21:06 +0100 Subject: [PATCH] [REF] Flake8 --- document_extract_from_database/__openerp__.py | 17 ++++++++--------- document_extract_from_database/attachment.py | 11 ++++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/document_extract_from_database/__openerp__.py b/document_extract_from_database/__openerp__.py index 62b80f23b..0c8d87095 100755 --- a/document_extract_from_database/__openerp__.py +++ b/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 @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -################################################################################# +############################################################################### { "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: @@ -42,12 +43,10 @@ Make sure you've correctly defined the filestore in your database: Then go to your document list, select all the documents you want to extract. Then, "More > Document Extraction" """, - "demo" : [], - "data" : [ + "demo": [], + "data": [ 'document_view.xml' ], - 'installable' : True, - 'active' : False, + 'installable': True, + 'active': False, } - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/document_extract_from_database/attachment.py b/document_extract_from_database/attachment.py index 98bc003e7..b4f65b76f 100755 --- a/document_extract_from_database/attachment.py +++ b/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: \ No newline at end of file