Browse Source

Merge pull request #1636 from ecosoft-odoo/12.0-fix-excel_import_export-use_sudo_for_param

[12.0][FIX] excel_import_export, use sudo() to get param
12.0
Pedro M. Baeza 5 years ago
committed by GitHub
parent
commit
0e4479f5da
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      excel_import_export/models/xlsx_export.py
  2. 11
      excel_import_export/readme/HISTORY.rst

2
excel_import_export/models/xlsx_export.py

@ -236,7 +236,7 @@ class XLSXExport(models.AbstractModel):
return (out_file, out_name) return (out_file, out_name)
# Prepare temp file (from now, only xlsx file works for openpyxl) # Prepare temp file (from now, only xlsx file works for openpyxl)
decoded_data = base64.decodestring(template.datas) decoded_data = base64.decodestring(template.datas)
ConfParam = self.env['ir.config_parameter']
ConfParam = self.env['ir.config_parameter'].sudo()
ptemp = ConfParam.get_param('path_temp_file') or '/tmp' ptemp = ConfParam.get_param('path_temp_file') or '/tmp'
stamp = dt.utcnow().strftime('%H%M%S%f')[:-3] stamp = dt.utcnow().strftime('%H%M%S%f')[:-3]
ftemp = '%s/temp%s.xlsx' % (ptemp, stamp) ftemp = '%s/temp%s.xlsx' % (ptemp, stamp)

11
excel_import_export/readme/HISTORY.rst

@ -1,9 +1,14 @@
12.0.1.0.0 (2019-02-24)
12.0.1.0.2 (2019-08-07)
~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~
* Start of the history
* Small fix, to ensure that system parameter 'path_temp_file' (ir.config_parameter) is readable
12.0.1.0.2 (2019-06-24)
12.0.1.0.1 (2019-06-24)
~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~
* Fix wizard on v12 can't download sample template file - https://github.com/OCA/server-tools/issues/1574 * Fix wizard on v12 can't download sample template file - https://github.com/OCA/server-tools/issues/1574
12.0.1.0.0 (2019-02-24)
~~~~~~~~~~~~~~~~~~~~~~~
* Start of the history
Loading…
Cancel
Save