Automatic Update form OCA2FC Migrator

This commit is contained in:
Flectra Community Bot 2021-11-14 03:12:55 +00:00 committed by OCA2FC Migrator Bot
parent a9dbdc85cf
commit efe3638ca2
7 changed files with 29 additions and 8 deletions

View File

@ -15,8 +15,8 @@ addon | version | summary
[bi_sql_editor](bi_sql_editor/) | 2.0.1.0.0| BI Views builder, based on Materialized or Normal SQL Views
[report_wkhtmltopdf_param](report_wkhtmltopdf_param/) | 2.0.1.0.0| Add new parameters for a paper format to be used by wkhtmltopdf command as arguments.
[report_qweb_pdf_watermark](report_qweb_pdf_watermark/) | 2.0.1.0.0| Add watermarks to your QWEB PDF reports
[report_xlsx_helper](report_xlsx_helper/) | 2.0.1.0.0| Report xlsx helpers
[report_xlsx](report_xlsx/) | 2.0.1.0.3| Base module to create xlsx report
[report_xlsx_helper](report_xlsx_helper/) | 2.0.1.0.1| Report xlsx helpers
[report_xlsx](report_xlsx/) | 2.0.1.0.4| Base module to create xlsx report
[bi_view_editor](bi_view_editor/) | 2.0.1.0.0| Graphical BI views builder for Odoo
[report_qweb_encrypt](report_qweb_encrypt/) | 2.0.1.0.0| Allow to encrypt qweb pdfs
[report_qweb_parameter](report_qweb_parameter/) | 2.0.1.0.0| Add new parameters for qweb templates in order to reduce field length and check minimal length

View File

@ -108,6 +108,7 @@ Contributors
* Graeme Gellatly <gdgellatly@gmail.com>
* Cristian Salamea <cs@prisehub.com>
* Rod Schouteden <rod.schouteden@dynapps.be>
* Eugene Molotov <molotov@it-projects.info>
Maintainers
~~~~~~~~~~~

View File

@ -6,7 +6,7 @@
"author": "ACSONE SA/NV," "Creu Blanca," "Odoo Community Association (OCA)",
"website": "https://gitlab.com/flectra-community/reporting-engine",
"category": "Reporting",
"version": "2.0.1.0.3",
"version": "2.0.1.0.4",
"development_status": "Production/Stable",
"license": "AGPL-3",
"external_dependencies": {"python": ["xlsxwriter", "xlrd"]},

View File

@ -3,7 +3,8 @@
import json
from flectra.http import content_disposition, request, route
from flectra.http import content_disposition, request, route, serialize_exception
from flectra.tools import html_escape
from flectra.tools.safe_eval import safe_eval
from flectra.addons.web.controllers import main as report
@ -13,6 +14,13 @@ class ReportController(report.ReportController):
@route()
def report_routes(self, reportname, docids=None, converter=None, **data):
if converter == "xlsx":
return self._report_routes_xlsx(reportname, docids, converter, **data)
return super(ReportController, self).report_routes(
reportname, docids, converter, **data
)
def _report_routes_xlsx(self, reportname, docids=None, converter=None, **data):
try:
report = request.env["ir.actions.report"]._get_report_from_name(reportname)
context = dict(request.env.context)
if docids:
@ -42,6 +50,7 @@ class ReportController(report.ReportController):
("Content-Disposition", content_disposition(report_name + ".xlsx")),
]
return request.make_response(xlsx, headers=xlsxhttpheaders)
return super(ReportController, self).report_routes(
reportname, docids, converter, **data
)
except Exception as e:
se = serialize_exception(e)
error = {"code": 200, "message": "Flectra Server Error", "data": se}
return request.make_response(html_escape(json.dumps(error)))

View File

@ -455,6 +455,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<li>Graeme Gellatly &lt;<a class="reference external" href="mailto:gdgellatly&#64;gmail.com">gdgellatly&#64;gmail.com</a>&gt;</li>
<li>Cristian Salamea &lt;<a class="reference external" href="mailto:cs&#64;prisehub.com">cs&#64;prisehub.com</a>&gt;</li>
<li>Rod Schouteden &lt;<a class="reference external" href="mailto:rod.schouteden&#64;dynapps.be">rod.schouteden&#64;dynapps.be</a>&gt;</li>
<li>Eugene Molotov &lt;<a class="reference external" href="mailto:molotov&#64;it-projects.info">molotov&#64;it-projects.info</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">

View File

@ -6,7 +6,7 @@
"author": "Noviat, Odoo Community Association (OCA)",
"website": "https://gitlab.com/flectra-community/reporting-engine",
"category": "Reporting",
"version": "2.0.1.0.0",
"version": "2.0.1.0.1",
"license": "AGPL-3",
"depends": ["report_xlsx"],
"installable": True,

View File

@ -723,6 +723,7 @@ class ReportXlsxAbstract(models.AbstractModel):
if isinstance(cell_format, CodeType):
cell_format = self._eval(cell_format, render_space)
args_data.append(cell_format)
self._apply_formula_quirk(args_data, cell_type, cell_format)
if colspan > 1:
args_pos += [row_pos, pos + colspan - 1]
args = args_pos + args_data
@ -735,6 +736,15 @@ class ReportXlsxAbstract(models.AbstractModel):
return row_pos + 1
@staticmethod
def _apply_formula_quirk(args_data, cell_type, cell_format):
""" Insert empty value to force LibreOffice to recompute the value """
if cell_type == "formula":
if not cell_format:
# Insert positional argument for missing format
args_data.append(None)
args_data.append("")
@staticmethod
def _render(code):
return compile(code, "<string>", "eval")