diff --git a/__unported__/account_export_csv/__init__.py b/account_export_csv/__init__.py similarity index 100% rename from __unported__/account_export_csv/__init__.py rename to account_export_csv/__init__.py diff --git a/__unported__/account_export_csv/__openerp__.py b/account_export_csv/__openerp__.py similarity index 98% rename from __unported__/account_export_csv/__openerp__.py rename to account_export_csv/__openerp__.py index 71b981bc..3c432f5d 100644 --- a/__unported__/account_export_csv/__openerp__.py +++ b/account_export_csv/__openerp__.py @@ -45,6 +45,6 @@ 'wizard/account_export_csv_view.xml', 'menu.xml', ], - 'installable': False, + 'installable': True, 'active': False, } diff --git a/__unported__/account_export_csv/i18n/account_export_csv.po b/account_export_csv/i18n/account_export_csv.po similarity index 100% rename from __unported__/account_export_csv/i18n/account_export_csv.po rename to account_export_csv/i18n/account_export_csv.po diff --git a/__unported__/account_export_csv/i18n/fr.po b/account_export_csv/i18n/fr.po similarity index 100% rename from __unported__/account_export_csv/i18n/fr.po rename to account_export_csv/i18n/fr.po diff --git a/__unported__/account_export_csv/i18n/nl.po b/account_export_csv/i18n/nl.po similarity index 100% rename from __unported__/account_export_csv/i18n/nl.po rename to account_export_csv/i18n/nl.po diff --git a/__unported__/account_export_csv/menu.xml b/account_export_csv/menu.xml similarity index 100% rename from __unported__/account_export_csv/menu.xml rename to account_export_csv/menu.xml diff --git a/__unported__/account_export_csv/wizard/__init__.py b/account_export_csv/wizard/__init__.py similarity index 100% rename from __unported__/account_export_csv/wizard/__init__.py rename to account_export_csv/wizard/__init__.py diff --git a/__unported__/account_export_csv/wizard/account_export_csv.py b/account_export_csv/wizard/account_export_csv.py similarity index 97% rename from __unported__/account_export_csv/wizard/account_export_csv.py rename to account_export_csv/wizard/account_export_csv.py index 5d8f90f0..5d3d25c2 100644 --- a/__unported__/account_export_csv/wizard/account_export_csv.py +++ b/account_export_csv/wizard/account_export_csv.py @@ -23,8 +23,7 @@ import itertools import tempfile -import StringIO -import cStringIO +from cStringIO import StringIO import base64 import csv @@ -43,7 +42,7 @@ class AccountUnicodeWriter(object): def __init__(self, f, dialect=csv.excel, encoding="utf-8", **kwds): # Redirect output to a queue - self.queue = cStringIO.StringIO() + self.queue = StringIO() # created a writer with Excel formating settings self.writer = csv.writer(self.queue, dialect=dialect, **kwds) self.stream = f @@ -93,8 +92,6 @@ class AccountCSVExport(orm.TransientModel): 'journal_id', 'Journals', help='If empty, use all journals, only used for journal entries'), - 'fiscalyear_id': fields.many2one('account.fiscalyear', 'Fiscalyear', - required=True), 'export_filename': fields.char('Export CSV Filename', size=128), } @@ -105,7 +102,8 @@ class AccountCSVExport(orm.TransientModel): def _get_fiscalyear_default(self, cr, uid, context=None): fiscalyear_obj = self.pool['account.fiscalyear'] - context['company_id'] = self._get_company_default(cr, uid, context) + context = dict(context, + company_id=self._get_company_default(cr, uid, context)) return fiscalyear_obj.find(cr, uid, dt=None, exception=True, context=context) @@ -116,7 +114,7 @@ class AccountCSVExport(orm.TransientModel): def action_manual_export_account(self, cr, uid, ids, context=None): this = self.browse(cr, uid, ids)[0] rows = self.get_data(cr, uid, ids, "account", context) - file_data = StringIO.StringIO() + file_data = StringIO() try: writer = AccountUnicodeWriter(file_data) writer.writerows(rows) @@ -176,7 +174,7 @@ class AccountCSVExport(orm.TransientModel): def action_manual_export_analytic(self, cr, uid, ids, context=None): this = self.browse(cr, uid, ids)[0] rows = self.get_data(cr, uid, ids, "analytic", context) - file_data = StringIO.StringIO() + file_data = StringIO() try: writer = AccountUnicodeWriter(file_data) writer.writerows(rows) @@ -243,7 +241,7 @@ class AccountCSVExport(orm.TransientModel): """ Here we use TemporaryFile to avoid full filling the OpenERP worker Memory - We also write the data to the wizard with SQL query as write seams + We also write the data to the wizard with SQL query as write seems to use too much memory as well. Those improvements permitted to improve the export from a 100k line to diff --git a/__unported__/account_export_csv/wizard/account_export_csv_view.xml b/account_export_csv/wizard/account_export_csv_view.xml similarity index 100% rename from __unported__/account_export_csv/wizard/account_export_csv_view.xml rename to account_export_csv/wizard/account_export_csv_view.xml