Browse Source

[REF] Flake8

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

17
document_extract_from_database/__openerp__.py

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
#################################################################################
###############################################################################
# #
# OpenERP, Open Source Management Solution # OpenERP, Open Source Management Solution
# Copyright (C) 2012 Julius Network Solutions SARL <contact@julius.fr> # 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 # You should have received a copy of the GNU 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/>.
# #
#################################################################################
###############################################################################
{ {
"name": "Extract Documents from database", "name": "Extract Documents from database",
@ -32,7 +32,8 @@
"description": """ "description": """
Button to extract documents from your database 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: Make sure you've correctly defined the filestore in your database:
"Settings > Parameters > System Parameters", add for example: "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 go to your document list, select all the documents you want to extract.
Then, "More > Document Extraction" Then, "More > Document Extraction"
""", """,
"demo" : [],
"data" : [
"demo": [],
"data": [
'document_view.xml' 'document_view.xml'
], ],
'installable' : True,
'active' : False,
'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 import base64
class document_multiple_action(orm.TransientModel): class document_multiple_action(orm.TransientModel):
_name = "document.multiple.action" _name = "document.multiple.action"
_description = "Multiple action on document" _description = "Multiple action on document"
def write_again(self, cr, uid, ids, context=None): 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_obj = self.pool.get('ir.attachment')
document_ids = context.get('active_ids') document_ids = context.get('active_ids')
if document_ids: if document_ids:
document_obj.write_again(cr, uid, document_ids, context=context) document_obj.write_again(cr, uid, document_ids, context=context)
return True return True
class document_file(orm.Model): class document_file(orm.Model):
_inherit = 'ir.attachment' _inherit = 'ir.attachment'
@ -50,10 +53,8 @@ class document_file(orm.Model):
return True return True
def write_again(self, cr, uid, ids, context=None): def write_again(self, cr, uid, ids, context=None):
if context==None:
if context is None:
context = {} context = {}
for document_id in ids: for document_id in ids:
self._write_again(cr, uid, document_id, context=context) self._write_again(cr, uid, document_id, context=context)
return True return True
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
Loading…
Cancel
Save