[12.0][FIX] excel_import_export

wrong use of dict.iteritems() for python3
pull/2505/head
Kitti U 2019-04-02 10:36:13 +07:00 committed by Aungkokolin1997
parent 7010b15258
commit 6bce70e2af
2 changed files with 2 additions and 2 deletions

View File

@ -244,7 +244,7 @@ class XLSXExport(models.AbstractModel):
f.write(decoded_data) f.write(decoded_data)
f.seek(0) f.seek(0)
f.close() f.close()
# Workbook created, temp fie removed # Workbook created, temp file removed
wb = load_workbook(ftemp) wb = load_workbook(ftemp)
os.remove(ftemp) os.remove(ftemp)
# Start working with workbook # Start working with workbook

View File

@ -80,7 +80,7 @@ class ImportXLSXWizard(models.TransientModel):
# Context testing # Context testing
if self._context.get('template_context', False): if self._context.get('template_context', False):
template_context = self._context['template_context'] template_context = self._context['template_context']
for key, value in template_context.iteritems(): for key, value in template_context.items():
if key not in record or \ if key not in record or \
(record._fields[key].type == 'many2one' and (record._fields[key].type == 'many2one' and
record[key].id or record[key]) != value: record[key].id or record[key]) != value: