Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[12.0][FIX] l10n_nl_xaf_auditfile_export: avoid character / in filename #250

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def button_generate(self):
'xmlns="http://www.auditfiles.nl/XAF/3.2">', 1)

filename = self.name + '.xaf'
filename = filename.replace(os.sep, ' ')
tmpdir = mkdtemp()
auditfile = os.path.join(tmpdir, filename)
archivedir = mkdtemp()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import base64
from io import BytesIO
import os
from zipfile import ZipFile

from odoo.tests.common import TransactionCase
Expand Down Expand Up @@ -89,3 +90,10 @@ def test_04_export_success_unit4(self):
filelist = archive.filelist
contents = archive.read(filelist[-1]).decode()
self.assertTrue(contents.startswith('<?xml '))

def test_05_export_success(self):
''' Export auditfile with / character in filename '''
record = self.env['xaf.auditfile.export'].create({})
record.name += '%s01' % os.sep
record.button_generate()
self.assertTrue(record)