IMP acc_export_csv: reinitialize StringIO instead of flush
parent
c295e79f35
commit
0827550d46
|
@ -38,11 +38,9 @@ class AccountingWriter(object):
|
|||
data = self.encoder.encode(data)
|
||||
# write to the target stream
|
||||
self.stream.write(data)
|
||||
# empty queue with seek() instead of truncate()
|
||||
# see https://stackoverflow.com/a/9729516
|
||||
# also problems with seek() if next line is shorter than previous
|
||||
# chars of previous line are kept in the new one
|
||||
self.queue.flush()
|
||||
# seek() or truncate() have side effect then we reinitialize StringIO
|
||||
# https://stackoverflow.com/questions/4330812/how-do-i-clear-a-stringio-object
|
||||
self.queue = StringIO()
|
||||
|
||||
def writerows(self, rows):
|
||||
for row in rows:
|
||||
|
|
|
@ -33,9 +33,9 @@
|
|||
<field name="data" filename="export_filename"/>
|
||||
</group>
|
||||
<footer>
|
||||
<button name="action_manual_export_account" string="Trial Balance" type="object" icon="fa-cog" class="oe_highlight"/>
|
||||
<button name="action_manual_export_analytic" string="Analytic Balance (with accounts)" type="object" icon="fa-cog" class="oe_highlight"/>
|
||||
<button name="action_manual_export_journal_entries" string="Journal Entries" type="object" icon="fa-cog" class="oe_highlight"/>
|
||||
<button name="action_manual_export_account" string="Trial Balance" type="object" icon="fa-cog"/>
|
||||
<button name="action_manual_export_analytic" string="Analytic Balance (with accounts)" type="object" icon="fa-cog"/>
|
||||
<button name="action_manual_export_journal_entries" string="Journal Entries" type="object" icon="fa-cog"/>
|
||||
or
|
||||
<button string="Close" class="oe_link" special="cancel" />
|
||||
</footer>
|
||||
|
|
Loading…
Reference in New Issue