mirror of
https://github.com/NaN-tic/trytond-csv_import.git
synced 2023-12-14 02:02:55 +01:00
Changed the path where csv files are stored. Now takes the 'data_path' variable of the trytond config file.
This commit is contained in:
parent
7ce4c23a2b
commit
34f8c09a5e
|
@ -171,9 +171,13 @@ class CSVArchive(Workflow, ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def set_data(cls, archives, name, value):
|
||||
path = os.path.abspath(os.path.dirname(__file__))
|
||||
cursor = Transaction().cursor
|
||||
path = os.path.join(CONFIG.get('data_path', '/var/lib/trytond'),
|
||||
cursor.database_name, 'csv_import')
|
||||
if not os.path.exists(path):
|
||||
os.makedirs(path, mode=0777)
|
||||
for archive in archives:
|
||||
archive = '%s/csv/%s' % (path, archive.archive_name)
|
||||
archive = '%s/%s' % (path, archive.archive_name)
|
||||
try:
|
||||
with open(archive, 'w') as f:
|
||||
f.write(value)
|
||||
|
|
Loading…
Reference in a new issue