Merge lp:~camptocamp/account-financial-report/account_csv_VRE into lp:~account-report-core-editor/account-financial-report/7.0

Proposed by Vincent Renaville@camptocamp
Status: Merged
Merged at revision: 28
Proposed branch: lp:~camptocamp/account-financial-report/account_csv_VRE
Merge into: lp:~account-report-core-editor/account-financial-report/7.0
Diff against target: 604 lines (+560/-0)
8 files modified
account_export_csv/__init__.py (+21/-0)
account_export_csv/__openerp__.py (+46/-0)
account_export_csv/i18n/account_export_csv.po (+111/-0)
account_export_csv/i18n/fr.po (+74/-0)
account_export_csv/menu.xml (+16/-0)
account_export_csv/wizard/__init__.py (+21/-0)
account_export_csv/wizard/account_export_csv.py (+226/-0)
account_export_csv/wizard/account_export_csv_view.xml (+45/-0)
To merge this branch: bzr merge lp:~camptocamp/account-financial-report/account_csv_VRE
Reviewer Review Type Date Requested Status
Alexandre Fayolle - camptocamp code review, no test Approve
Joël Grand-Guillaume @ camptocamp code review, no test, no translation review Pending
Review via email: mp+159101@code.launchpad.net

This proposal supersedes a proposal from 2013-04-11.

Description of the change

Add account_export_csv, that allow to export Trial Balance and Analytic Balance with accounts in CSV

I have change the license in this merge proposal

To post a comment you must log in.
Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote : Posted in a previous version of this proposal

Hi,

Thanks for this merge. My comments:

 - Use coding instead of encoding in file header

 - Split line 412

 - In account_export_csv.py, only 1 line after each method not more

 - get_data and get_data_analytic are so similar, I'd love to see the factorize by passing an args on which method to call (_analytic or _account) + renaming the _get_header_analytic, _get_row_analytic, _get_header and _get_row accordingly (e.g. _get_header_account and _get_header_analytic)

Otherwise it look good to me.

Regards,

review: Needs Fixing (code review, no test, no translation review)
Revision history for this message
Vincent Renaville@camptocamp (vrenaville-c2c) wrote : Posted in a previous version of this proposal

Thanks for your review

I will work on that , I will resubmit the fixes soon

Vincent

Revision history for this message
Vincent Renaville@camptocamp (vrenaville-c2c) wrote : Posted in a previous version of this proposal

Joel, I have fix according to your comment

Thanks for your review

Revision history for this message
Vincent Renaville@camptocamp (vrenaville-c2c) wrote : Posted in a previous version of this proposal

Hello,
I have improve the SQl for analytic in order to take also move line without analytic account

Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

LGTM

review: Approve (code review, no test)
Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote : Posted in a previous version of this proposal

Thanks for fixing, it LGTM !

review: Approve (code review, no test)
Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote : Posted in a previous version of this proposal

Thanks for fixing, it LGTM !

review: Approve (thanks for fixing, it lgtm !)
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote : Posted in a previous version of this proposal

The _get_rows_account and _get_rows_analytic methods take a 'company_id' argument, this one is passed to the query, but this one does not use it, so the lines are not multi-company aware.
I'm not sure if it should be done directly in the query or if you should leave the query as is and do a self.search(cr, uid, [('id', 'in', line_ids)], context=context) afterwards to apply the rules.

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'account_export_csv'
2=== added file 'account_export_csv/__init__.py'
3--- account_export_csv/__init__.py 1970-01-01 00:00:00 +0000
4+++ account_export_csv/__init__.py 2013-04-16 08:33:27 +0000
5@@ -0,0 +1,21 @@
6+# -*- coding: utf-8 -*-
7+##############################################################################
8+#
9+# Author Joel Grand-Guillaume and Vincent Renaville Copyright 2013 Camptocamp SA
10+#
11+# This program is free software: you can redistribute it and/or modify
12+# it under the terms of the GNU Affero General Public License as
13+# published by the Free Software Foundation, either version 3 of the
14+# License, or (at your option) any later version.
15+#
16+# This program is distributed in the hope that it will be useful,
17+# but WITHOUT ANY WARRANTY; without even the implied warranty of
18+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+# GNU Affero General Public License for more details.
20+#
21+# You should have received a copy of the GNU Affero General Public License
22+# along with this program. If not, see <http://www.gnu.org/licenses/>.
23+#
24+##############################################################################
25+
26+import wizard
27\ No newline at end of file
28
29=== added file 'account_export_csv/__openerp__.py'
30--- account_export_csv/__openerp__.py 1970-01-01 00:00:00 +0000
31+++ account_export_csv/__openerp__.py 2013-04-16 08:33:27 +0000
32@@ -0,0 +1,46 @@
33+# -*- coding: utf-8 -*-
34+##############################################################################
35+#
36+# Author Joel Grand-Guillaume and Vincent Renaville Copyright 2013 Camptocamp SA
37+#
38+# This program is free software: you can redistribute it and/or modify
39+# it under the terms of the GNU Affero General Public License as
40+# published by the Free Software Foundation, either version 3 of the
41+# License, or (at your option) any later version.
42+#
43+# This program is distributed in the hope that it will be useful,
44+# but WITHOUT ANY WARRANTY; without even the implied warranty of
45+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
46+# GNU Affero General Public License for more details.
47+#
48+# You should have received a copy of the GNU Affero General Public License
49+# along with this program. If not, see <http://www.gnu.org/licenses/>.
50+#
51+##############################################################################
52+
53+{
54+ 'name' : 'Account Export CSV',
55+ 'version' : '1',
56+ 'depends' : [
57+ 'account',
58+ ],
59+ 'author' : 'Camptocamp',
60+ 'description': """
61+
62+ Add a wizard that allow you to export a csv file based on accounting journal entries
63+
64+ - Trial Balance
65+ - Analytic Balance (with accounts)
66+
67+ You can filter by period
68+
69+
70+ """,
71+ 'website': 'http://www.camptocamp.com',
72+ 'data': [
73+ 'wizard/account_export_csv_view.xml',
74+ 'menu.xml',
75+ ],
76+ 'installable': True,
77+ 'active': False,
78+}
79
80=== added directory 'account_export_csv/i18n'
81=== added file 'account_export_csv/i18n/account_export_csv.po'
82--- account_export_csv/i18n/account_export_csv.po 1970-01-01 00:00:00 +0000
83+++ account_export_csv/i18n/account_export_csv.po 2013-04-16 08:33:27 +0000
84@@ -0,0 +1,111 @@
85+# Translation of OpenERP Server.
86+# This file contains the translation of the following modules:
87+# * account_export_csv
88+#
89+msgid ""
90+msgstr ""
91+"Project-Id-Version: OpenERP Server 7.0\n"
92+"Report-Msgid-Bugs-To: \n"
93+"POT-Creation-Date: 2013-04-10 15:11+0000\n"
94+"PO-Revision-Date: 2013-04-10 15:11+0000\n"
95+"Last-Translator: <>\n"
96+"Language-Team: \n"
97+"MIME-Version: 1.0\n"
98+"Content-Type: text/plain; charset=UTF-8\n"
99+"Content-Transfer-Encoding: \n"
100+"Plural-Forms: \n"
101+
102+#. module: account_export_csv
103+#: model:ir.model,name:account_export_csv.model_account_csv_export
104+msgid "Export Accounting"
105+msgstr ""
106+
107+#. module: account_export_csv
108+#: field:account.csv.export,export_filename:0
109+msgid "Export CSV Filename"
110+msgstr ""
111+
112+#. module: account_export_csv
113+#: view:account.csv.export:0
114+msgid "Trial Balance"
115+msgstr ""
116+
117+#. module: account_export_csv
118+#: field:account.csv.export,company_id:0
119+msgid "Company"
120+msgstr ""
121+
122+#. module: account_export_csv
123+#: view:account.csv.export:0
124+msgid "Analytic Balance (with accounts)"
125+msgstr ""
126+
127+#. module: account_export_csv
128+#: help:account.csv.export,periods:0
129+msgid "All periods in the fiscal year if empty"
130+msgstr ""
131+
132+#. module: account_export_csv
133+#: field:account.csv.export,periods:0
134+msgid "Periods"
135+msgstr ""
136+
137+#. module: account_export_csv
138+#: view:account.csv.export:0
139+msgid "Close"
140+msgstr ""
141+
142+#. module: account_export_csv
143+#: view:account.csv.export:0
144+#: model:ir.actions.act_window,name:account_export_csv.action_account_csv_export
145+#: model:ir.ui.menu,name:account_export_csv.menu_account_csv_export
146+msgid "Accounting CSV Export"
147+msgstr ""
148+
149+#. module: account_export_csv
150+#: field:account.csv.export,data:0
151+msgid "CSV"
152+msgstr ""
153+
154+#. module: account_export_csv
155+#: field:account.csv.export,fiscalyear_id:0
156+msgid "Fiscalyear"
157+msgstr ""
158+
159+#. module: account_export_csv
160+#: view:account.csv.export:0
161+msgid "Analytic Balance (with accounts)"
162+msgstr ""
163+
164+#. module: account_export_csv
165+#: field:account.csv.export,stop_period_id:0
166+msgid "End period"
167+msgstr ""
168+
169+#. module: account_export_csv
170+#: view:account.csv.export:0
171+msgid "Close"
172+msgstr ""
173+
174+#. module: account_export_csv
175+#: view:account.csv.export:0
176+#: model:ir.actions.act_window,name:account_export_csv.action_account_csv_export
177+#: model:ir.ui.menu,name:account_export_csv.menu_account_csv_export
178+msgid "Accounting CSV Export"
179+msgstr ""
180+
181+#. module: account_export_csv
182+#: field:account.csv.export,data:0
183+msgid "CSV"
184+msgstr ""
185+
186+#. module: account_export_csv
187+#: model:ir.model,name:account_export_csv.model_account_csv_export
188+msgid "Export Accounting Entries"
189+msgstr ""
190+
191+#. module: account_export_csv
192+#: field:account.csv.export,fiscalyear_id:0
193+msgid "Fiscalyear"
194+msgstr ""
195+
196
197=== added file 'account_export_csv/i18n/fr.po'
198--- account_export_csv/i18n/fr.po 1970-01-01 00:00:00 +0000
199+++ account_export_csv/i18n/fr.po 2013-04-16 08:33:27 +0000
200@@ -0,0 +1,74 @@
201+# Translation of OpenERP Server.
202+# This file contains the translation of the following modules:
203+# * account_export_csv
204+#
205+msgid ""
206+msgstr ""
207+"Project-Id-Version: OpenERP Server 7.0\n"
208+"Report-Msgid-Bugs-To: \n"
209+"POT-Creation-Date: 2013-04-10 15:11+0000\n"
210+"PO-Revision-Date: 2013-04-10 15:11+0000\n"
211+"Last-Translator: <>\n"
212+"Language-Team: \n"
213+"MIME-Version: 1.0\n"
214+"Content-Type: text/plain; charset=UTF-8\n"
215+"Content-Transfer-Encoding: \n"
216+"Plural-Forms: \n"
217+
218+#. module: account_export_csv
219+#: model:ir.model,name:account_export_csv.model_account_csv_export
220+msgid "Export Accounting"
221+msgstr "Export comptable"
222+
223+#. module: account_export_csv
224+#: field:account.csv.export,export_filename:0
225+msgid "Export CSV Filename"
226+msgstr "Nom du fichier CSV d'export"
227+
228+#. module: account_export_csv
229+#: view:account.csv.export:0
230+msgid "Trial Balance"
231+msgstr "Balance générale"
232+
233+#. module: account_export_csv
234+#: field:account.csv.export,company_id:0
235+msgid "Company"
236+msgstr "Société"
237+
238+#. module: account_export_csv
239+#: view:account.csv.export:0
240+msgid "Analytic Balance (with accounts)"
241+msgstr "Balance analytique (avec comptes)"
242+
243+#. module: account_export_csv
244+#: help:account.csv.export,periods:0
245+msgid "All periods in the fiscal year if empty"
246+msgstr "Toutes les périodes de l'année fiscale si vide"
247+
248+#. module: account_export_csv
249+#: field:account.csv.export,periods:0
250+msgid "Periods"
251+msgstr "Périodes"
252+
253+#. module: account_export_csv
254+#: view:account.csv.export:0
255+msgid "Close"
256+msgstr "Fermer"
257+
258+#. module: account_export_csv
259+#: view:account.csv.export:0
260+#: model:ir.actions.act_window,name:account_export_csv.action_account_csv_export
261+#: model:ir.ui.menu,name:account_export_csv.menu_account_csv_export
262+msgid "Accounting CSV Export"
263+msgstr "Export comptable CSV"
264+
265+#. module: account_export_csv
266+#: field:account.csv.export,data:0
267+msgid "CSV"
268+msgstr "CSV"
269+
270+#. module: account_export_csv
271+#: field:account.csv.export,fiscalyear_id:0
272+msgid "Fiscalyear"
273+msgstr "Année fiscale"
274+
275
276=== added file 'account_export_csv/menu.xml'
277--- account_export_csv/menu.xml 1970-01-01 00:00:00 +0000
278+++ account_export_csv/menu.xml 2013-04-16 08:33:27 +0000
279@@ -0,0 +1,16 @@
280+<?xml version="1.0" encoding="utf-8"?>
281+<openerp>
282+ <data>
283+
284+ <menuitem
285+ icon="STOCK_EXECUTE"
286+ name="Accounting CSV Export"
287+ action="action_account_csv_export"
288+ id="menu_account_csv_export"
289+ parent="account.menu_finance_reports"
290+ sequence="110"
291+ />
292+
293+
294+ </data>
295+</openerp>
296
297=== added directory 'account_export_csv/wizard'
298=== added file 'account_export_csv/wizard/__init__.py'
299--- account_export_csv/wizard/__init__.py 1970-01-01 00:00:00 +0000
300+++ account_export_csv/wizard/__init__.py 2013-04-16 08:33:27 +0000
301@@ -0,0 +1,21 @@
302+# -*- coding: utf-8 -*-
303+##############################################################################
304+#
305+# Author Joel Grand-Guillaume and Vincent Renaville Copyright 2013 Camptocamp SA
306+#
307+# This program is free software: you can redistribute it and/or modify
308+# it under the terms of the GNU Affero General Public License as
309+# published by the Free Software Foundation, either version 3 of the
310+# License, or (at your option) any later version.
311+#
312+# This program is distributed in the hope that it will be useful,
313+# but WITHOUT ANY WARRANTY; without even the implied warranty of
314+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
315+# GNU Affero General Public License for more details.
316+#
317+# You should have received a copy of the GNU Affero General Public License
318+# along with this program. If not, see <http://www.gnu.org/licenses/>.
319+#
320+##############################################################################
321+
322+import account_export_csv
323\ No newline at end of file
324
325=== added file 'account_export_csv/wizard/account_export_csv.py'
326--- account_export_csv/wizard/account_export_csv.py 1970-01-01 00:00:00 +0000
327+++ account_export_csv/wizard/account_export_csv.py 2013-04-16 08:33:27 +0000
328@@ -0,0 +1,226 @@
329+# -*- coding: utf-8 -*-
330+##############################################################################
331+#
332+# Author Joel Grand-Guillaume and Vincent Renaville Copyright 2013 Camptocamp SA
333+# CSV data formating inspired from http://docs.python.org/2.7/library/csv.html?highlight=csv#examples
334+#
335+# This program is free software: you can redistribute it and/or modify
336+# it under the terms of the GNU Affero General Public License as
337+# published by the Free Software Foundation, either version 3 of the
338+# License, or (at your option) any later version.
339+#
340+# This program is distributed in the hope that it will be useful,
341+# but WITHOUT ANY WARRANTY; without even the implied warranty of
342+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
343+# GNU Affero General Public License for more details.
344+#
345+# You should have received a copy of the GNU Affero General Public License
346+# along with this program. If not, see <http://www.gnu.org/licenses/>.
347+#
348+##############################################################################
349+
350+import time
351+import StringIO
352+import cStringIO
353+import base64
354+
355+import csv
356+import codecs
357+
358+from openerp.osv import orm, fields
359+from openerp.tools.translate import _
360+
361+
362+class AccountUnicodeWriter(object):
363+ """
364+ A CSV writer which will write rows to CSV file "f",
365+ which is encoded in the given encoding.
366+ """
367+
368+ def __init__(self, f, dialect=csv.excel, encoding="utf-8", **kwds):
369+ # Redirect output to a queue
370+ self.queue = cStringIO.StringIO()
371+ # created a writer with Excel formating settings
372+ self.writer = csv.writer(self.queue, dialect=dialect, **kwds)
373+ self.stream = f
374+ self.encoder = codecs.getincrementalencoder(encoding)()
375+
376+ def writerow(self, row):
377+ #we ensure that we do not try to encode none or bool
378+ row = [x or u'' for x in row]
379+
380+ encoded_row = []
381+ for c in row:
382+ if type(c) == unicode:
383+ encoded_row.append(c.encode("utf-8"))
384+ else:
385+ encoded_row.append(c)
386+
387+ self.writer.writerow(encoded_row)
388+ # Fetch UTF-8 output from the queue ...
389+ data = self.queue.getvalue()
390+ data = data.decode("utf-8")
391+ # ... and reencode it into the target encoding
392+ data = self.encoder.encode(data)
393+ # write to the target stream
394+ self.stream.write(data)
395+ # empty queue
396+ self.queue.truncate(0)
397+
398+ def writerows(self, rows):
399+ for row in rows:
400+ self.writerow(row)
401+
402+class AccountCSVExport(orm.TransientModel):
403+ _name = 'account.csv.export'
404+ _description = 'Export Accounting'
405+
406+ _columns = {
407+ 'data': fields.binary('CSV',readonly=True),
408+ 'company_id': fields.many2one('res.company', 'Company', invisible=True),
409+ 'fiscalyear_id': fields.many2one('account.fiscalyear', 'Fiscalyear', required=True),
410+ 'periods': fields.many2many('account.period','rel_wizard_period','wizard_id','period_id','Periods',help='All periods in the fiscal year if empty'),
411+ 'export_filename': fields.char('Export CSV Filename', size=128),
412+ }
413+
414+ def _get_company_default(self, cr, uid, context=None):
415+ comp_obj = self.pool['res.company']
416+ return comp_obj._company_default_get(cr, uid, 'account.fiscalyear', context=context)
417+
418+ def _get_fiscalyear_default(self, cr, uid, context=None):
419+ fiscalyear_obj = self.pool['account.fiscalyear']
420+ context['company_id'] = self._get_company_default(cr, uid, context)
421+ return fiscalyear_obj.find(cr,uid,dt=None,exception=True, context=context)
422+
423+ _defaults = {'company_id': _get_company_default,
424+ 'fiscalyear_id' : _get_fiscalyear_default,
425+ 'export_filename' : 'account_export.csv'}
426+
427+ def action_manual_export_account(self, cr, uid, ids, context=None):
428+ this = self.browse(cr, uid, ids)[0]
429+ rows = self.get_data(cr, uid, ids,"account", context)
430+ file_data = StringIO.StringIO()
431+ try:
432+ writer = AccountUnicodeWriter(file_data)
433+ writer.writerows(rows)
434+ file_value = file_data.getvalue()
435+ self.write(cr, uid, ids,
436+ {'data': base64.encodestring(file_value)},
437+ context=context)
438+ finally:
439+ file_data.close()
440+ return {
441+ 'type': 'ir.actions.act_window',
442+ 'res_model': 'account.csv.export',
443+ 'view_mode': 'form',
444+ 'view_type': 'form',
445+ 'res_id': this.id,
446+ 'views': [(False, 'form')],
447+ 'target': 'new',
448+ }
449+
450+
451+ def _get_header_account(self, cr, uid, ids, context=None):
452+ return [_(u'CODE'),
453+ _(u'NAME'),
454+ _(u'DEBIT'),
455+ _(u'CREDIT'),
456+ _(u'BALANCE'),
457+ ]
458+
459+ def _get_rows_account(self, cr, uid, ids, fiscalyear_id,period_range_ids,company_id,context=None):
460+ """
461+ Return list to generate rows of the CSV file
462+ """
463+ cr.execute("""
464+ select ac.code,ac.name,
465+ sum(debit) as sum_debit,sum(credit) as sum_credit,sum(debit) - sum(credit) as balance
466+ from account_move_line as aml,account_account as ac
467+ where aml.account_id = ac.id
468+ and period_id in %(period_ids)s
469+ group by ac.id,ac.code,ac.name
470+ order by ac.code
471+ """,
472+ {'fiscalyear_id': fiscalyear_id,'company_id':company_id,'period_ids':tuple(period_range_ids)}
473+ )
474+ res = cr.fetchall()
475+
476+ rows = []
477+ for line in res:
478+ rows.append(list(line))
479+ return rows
480+
481+ def action_manual_export_analytic(self, cr, uid, ids, context=None):
482+ this = self.browse(cr, uid, ids)[0]
483+ rows = self.get_data(cr, uid, ids,"analytic", context)
484+ file_data = StringIO.StringIO()
485+ try:
486+ writer = AccountUnicodeWriter(file_data)
487+ writer.writerows(rows)
488+ file_value = file_data.getvalue()
489+ self.write(cr, uid, ids,
490+ {'data': base64.encodestring(file_value)},
491+ context=context)
492+ finally:
493+ file_data.close()
494+ return {
495+ 'type': 'ir.actions.act_window',
496+ 'res_model': 'account.csv.export',
497+ 'view_mode': 'form',
498+ 'view_type': 'form',
499+ 'res_id': this.id,
500+ 'views': [(False, 'form')],
501+ 'target': 'new',
502+ }
503+
504+ def _get_header_analytic(self, cr, uid, ids, context=None):
505+ return [_(u'ANALYTIC CODE'),
506+ _(u'ANALYTIC NAME'),
507+ _(u'CODE'),
508+ _(u'ACCOUNT NAME'),
509+ _(u'DEBIT'),
510+ _(u'CREDIT'),
511+ _(u'BALANCE'),
512+ ]
513+
514+ def _get_rows_analytic(self, cr, uid, ids, fiscalyear_id,period_range_ids,company_id,context=None):
515+ """
516+ Return list to generate rows of the CSV file
517+ """
518+ cr.execute(""" select aac.code as analytic_code,aac.name as analytic_name,ac.code,ac.name,
519+ sum(debit) as sum_debit,sum(credit) as sum_credit,sum(debit) - sum(credit) as balance
520+ from account_move_line
521+ left outer join account_analytic_account as aac
522+ on (account_move_line.analytic_account_id = aac.id)
523+ inner join account_account as ac
524+ on account_move_line.account_id = ac.id
525+ and account_move_line.period_id in %(period_ids)s
526+ group by aac.id,aac.code,aac.name,ac.id,ac.code,ac.name
527+ order by aac.code
528+ """,
529+ {'fiscalyear_id': fiscalyear_id,'company_id':company_id,'period_ids':tuple(period_range_ids)}
530+ )
531+ res = cr.fetchall()
532+
533+ rows = []
534+ for line in res:
535+ rows.append(list(line))
536+ return rows
537+
538+ def get_data(self, cr, uid, ids,result_type,context=None):
539+ get_header_func = getattr(self,("_get_header_%s"%(result_type)), None)
540+ get_rows_func = getattr(self,("_get_rows_%s"%(result_type)), None)
541+ form = self.browse(cr, uid, ids[0], context=context)
542+ fiscalyear_id = form.fiscalyear_id.id
543+ user_obj = self.pool.get('res.users')
544+ company_id = user_obj.browse(cr, uid, uid).company_id.id
545+ if form.periods:
546+ period_range_ids = [x.id for x in form.periods]
547+ else:
548+ # If not period selected , we take all periods
549+ p_obj = self.pool.get("account.period")
550+ period_range_ids = p_obj.search(cr,uid,[('fiscalyear_id','=',fiscalyear_id)],context=context)
551+ rows = []
552+ rows.append(get_header_func(cr, uid, ids, context=context))
553+ rows.extend(get_rows_func(cr, uid, ids, fiscalyear_id,period_range_ids,company_id, context=context))
554+ return rows
555
556=== added file 'account_export_csv/wizard/account_export_csv_view.xml'
557--- account_export_csv/wizard/account_export_csv_view.xml 1970-01-01 00:00:00 +0000
558+++ account_export_csv/wizard/account_export_csv_view.xml 2013-04-16 08:33:27 +0000
559@@ -0,0 +1,45 @@
560+<?xml version="1.0" encoding="utf-8"?>
561+<openerp>
562+ <data>
563+
564+ <record id="account_csv_export_view" model="ir.ui.view">
565+ <field name="name">Accounting Entries CSV Export</field>
566+ <field name="model">account.csv.export</field>
567+ <field name="type">form</field>
568+ <field name="arch" type="xml">
569+ <form string="Accounting CSV Export">
570+ <group colspan="4">
571+ <field name="company_id" />
572+ <field name="fiscalyear_id" domain="[('company_id', '=', company_id)]"/>
573+ </group>
574+ <group colspan="4" col="2">
575+ <field name="periods" domain="[('state', '=', 'draft'),('fiscalyear_id','=',fiscalyear_id)]"/>
576+ </group>
577+ <separator string ="" colspan="4"/>
578+ <group colspan="4" col="3">
579+ <button special="cancel" string="Close" icon="gtk-cancel"/>
580+ <button name="action_manual_export_account" string="Trial Balance" type="object" icon="gtk-execute"/>
581+ <button name="action_manual_export_analytic" string="Analytic Balance (with accounts)" type="object" icon="gtk-execute"/>
582+ </group>
583+ <separator string ="" colspan="4"/>
584+ <group colspan="4">
585+ <field name="data" filename="export_filename"/>
586+ </group>
587+
588+ </form>
589+ </field>
590+ </record>
591+
592+ <record id="action_account_csv_export" model="ir.actions.act_window">
593+ <field name="name">Accounting CSV Export</field>
594+ <field name="res_model">account.csv.export</field>
595+ <field name="type">ir.actions.act_window</field>
596+ <field name="view_type">form</field>
597+ <field name="view_mode">tree,form</field>
598+ <field name="view_id" ref="account_csv_export_view"/>
599+ <field name="context">{}</field>
600+ <field name="target">new</field>
601+ </record>
602+
603+ </data>
604+</openerp>

Subscribers

People subscribed via source and target branches

to status/vote changes: