Browse Source

[12.0][ENH] report_xlsx_helper : dynamic function _write_line

14.0
Saran440 5 years ago
parent
commit
1c14f4001e
  1. 2
      report_xlsx_helper/readme/CONTRIBUTORS.rst
  2. 6
      report_xlsx_helper/report/report_xlsx_abstract.py

2
report_xlsx_helper/readme/CONTRIBUTORS.rst

@ -1,2 +1,4 @@
* Luc De Meyer <luc.demeyer@noviat.com> * Luc De Meyer <luc.demeyer@noviat.com>
* Rattapong Chokmasermkul <rattapongc@ecosoft.co.th> * Rattapong Chokmasermkul <rattapongc@ecosoft.co.th>
* Saran Lim. <saranl@ecosoft.co.th>

6
report_xlsx_helper/report/report_xlsx_abstract.py

@ -569,6 +569,8 @@ class ReportXlsxAbstract(models.AbstractModel):
col_specs_section=None, col_specs_section=None,
render_space=None, render_space=None,
default_format=None, default_format=None,
col_specs='col_specs',
wanted_list='wanted_list',
): ):
""" """
Write a line with all columns included in the 'wanted_list'. Write a line with all columns included in the 'wanted_list'.
@ -576,8 +578,8 @@ class ReportXlsxAbstract(models.AbstractModel):
An empty cell will be written if no col_specs_section entry An empty cell will be written if no col_specs_section entry
for a column. for a column.
""" """
col_specs = ws_params.get("col_specs")
wl = ws_params.get("wanted_list") or []
col_specs = ws_params.get(col_specs)
wl = ws_params.get(wanted_list) or []
pos = 0 pos = 0
for col in wl: for col in wl:
if col not in col_specs: if col not in col_specs:

Loading…
Cancel
Save