diff --git a/.travis.yml b/.travis.yml index 7a7205d80..460dda603 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ addons: packages: - expect-dev # provides unbuffer utility - python-lxml # because pip installation is slow - + - pdftk # required in reporting-engine repo language: python diff --git a/README.md b/README.md index 4687f3389..3dbbb2f78 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,6 @@ Management Information System reports for Odoo: easily build super fast, beautiful, custom reports such as P&L, Balance Sheets and more. -**Odoo 11.0 is not supported yet, nothing to see here for now.** - **This is the 11.0 branch. Please note the development of new features occurs mainly on the 10.0 branch, to be forward-ported to 11.0. Please submit pull requests to the 10.0 branch in priority, unless they are 11.0 specific bugs, or they rely on diff --git a/mis_builder/__init__.py b/mis_builder/__init__.py index f945ab07b..659dda150 100644 --- a/mis_builder/__init__.py +++ b/mis_builder/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2014-2015 ACSONE SA/NV () # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). diff --git a/mis_builder/__manifest__.py b/mis_builder/__manifest__.py index 174d8e20d..795827c89 100644 --- a/mis_builder/__manifest__.py +++ b/mis_builder/__manifest__.py @@ -1,10 +1,9 @@ -# -*- coding: utf-8 -*- # Copyright 2014-2017 ACSONE SA/NV () # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). { 'name': 'MIS Builder', - 'version': '10.0.3.1.1', + 'version': '11.0.3.1.1', 'category': 'Reporting', 'summary': """ Build 'Management Information System' Reports and Dashboards @@ -31,9 +30,9 @@ 'report/mis_report_instance_xlsx.xml', ], 'qweb': [ - 'static/src/xml/*.xml' + 'static/src/xml/mis_report_widget.xml', ], - 'installable': False, + 'installable': True, 'application': True, 'license': 'AGPL-3', } diff --git a/mis_builder/datas/ir_cron.xml b/mis_builder/datas/ir_cron.xml index dcd0d24c4..ba26f937c 100644 --- a/mis_builder/datas/ir_cron.xml +++ b/mis_builder/datas/ir_cron.xml @@ -7,9 +7,8 @@ hours -1 - - - + + model._vacuum_report() diff --git a/mis_builder/migrations/8.0.2.0.0/post-migration.py b/mis_builder/migrations/8.0.2.0.0/post-migration.py index f2155d6a5..6f8ec151f 100644 --- a/mis_builder/migrations/8.0.2.0.0/post-migration.py +++ b/mis_builder/migrations/8.0.2.0.0/post-migration.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2017 ACSONE SA/NV () # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). diff --git a/mis_builder/migrations/8.0.2.0.0/pre-migration.py b/mis_builder/migrations/8.0.2.0.0/pre-migration.py index 298bdbbe4..c1418bbcf 100644 --- a/mis_builder/migrations/8.0.2.0.0/pre-migration.py +++ b/mis_builder/migrations/8.0.2.0.0/pre-migration.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2017 ACSONE SA/NV () # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). diff --git a/mis_builder/models/__init__.py b/mis_builder/models/__init__.py index 714196c00..efc6bd060 100644 --- a/mis_builder/models/__init__.py +++ b/mis_builder/models/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2014-2015 ACSONE SA/NV () # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). diff --git a/mis_builder/models/accounting_none.py b/mis_builder/models/accounting_none.py index 8d05fc531..8151e603f 100644 --- a/mis_builder/models/accounting_none.py +++ b/mis_builder/models/accounting_none.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016 Thomas Binsfeld # Copyright 2016-2017 ACSONE SA/NV () # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). diff --git a/mis_builder/models/aep.py b/mis_builder/models/aep.py index 2c7d9defd..4d05b2f3c 100644 --- a/mis_builder/models/aep.py +++ b/mis_builder/models/aep.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2014-2017 ACSONE SA/NV () # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). diff --git a/mis_builder/models/aggregate.py b/mis_builder/models/aggregate.py index 067126de3..edfedbd42 100644 --- a/mis_builder/models/aggregate.py +++ b/mis_builder/models/aggregate.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2014-2017 ACSONE SA/NV () # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). diff --git a/mis_builder/models/data_error.py b/mis_builder/models/data_error.py index 29cbae239..6ce87c4fd 100644 --- a/mis_builder/models/data_error.py +++ b/mis_builder/models/data_error.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016-2017 ACSONE SA/NV () # Copyright 2016 Akretion () # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). diff --git a/mis_builder/models/kpimatrix.py b/mis_builder/models/kpimatrix.py index 241d04f2d..9744292dc 100644 --- a/mis_builder/models/kpimatrix.py +++ b/mis_builder/models/kpimatrix.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2014-2017 ACSONE SA/NV () # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). diff --git a/mis_builder/models/mis_kpi_data.py b/mis_builder/models/mis_kpi_data.py index 639298053..c2bcfbc5a 100644 --- a/mis_builder/models/mis_kpi_data.py +++ b/mis_builder/models/mis_kpi_data.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2017 ACSONE SA/NV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/mis_builder/models/mis_report.py b/mis_builder/models/mis_report.py index b8a60c851..1a22e212a 100644 --- a/mis_builder/models/mis_report.py +++ b/mis_builder/models/mis_report.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2014-2017 ACSONE SA/NV () # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). diff --git a/mis_builder/models/mis_report_instance.py b/mis_builder/models/mis_report_instance.py index dc53e4fe5..04d747da3 100644 --- a/mis_builder/models/mis_report_instance.py +++ b/mis_builder/models/mis_report_instance.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# Copyright 2014-2016 ACSONE SA/NV () +# Copyright 2014-2017 ACSONE SA/NV () # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). import datetime @@ -545,25 +544,28 @@ def preview(self): @api.multi def print_pdf(self): self.ensure_one() + context = dict(self.env.context, active_ids=self.ids) return { 'name': 'MIS report instance QWEB PDF report', 'model': 'mis.report.instance', - 'type': 'ir.actions.report.xml', + 'type': 'ir.actions.report', 'report_name': 'mis_builder.report_mis_report_instance', 'report_type': 'qweb-pdf', - 'context': self.env.context, + 'context': context, } @api.multi def export_xls(self): self.ensure_one() + context = dict(self.env.context, active_ids=self.ids) return { 'name': 'MIS report instance XLSX report', 'model': 'mis.report.instance', - 'type': 'ir.actions.report.xml', - 'report_name': 'mis.report.instance.xlsx', + 'type': 'ir.actions.report', + 'report_name': 'mis_builder.mis_report_instance_xlsx', 'report_type': 'xlsx', - 'context': self.env.context, + 'report_file': 'mis_report_instance', + 'context': context, } @api.multi diff --git a/mis_builder/models/mis_report_style.py b/mis_builder/models/mis_report_style.py index dc8a0c1d0..b71b41505 100644 --- a/mis_builder/models/mis_report_style.py +++ b/mis_builder/models/mis_report_style.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016 Therp BV () # Copyright 2016-2017 ACSONE SA/NV () # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). diff --git a/mis_builder/models/mis_safe_eval.py b/mis_builder/models/mis_safe_eval.py index 7082f3e1c..e57dd91da 100644 --- a/mis_builder/models/mis_safe_eval.py +++ b/mis_builder/models/mis_safe_eval.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016-2017 ACSONE SA/NV () # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). diff --git a/mis_builder/models/simple_array.py b/mis_builder/models/simple_array.py index fe778a4e5..a59389813 100644 --- a/mis_builder/models/simple_array.py +++ b/mis_builder/models/simple_array.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2014-2017 ACSONE SA/NV () # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). """ A trivial immutable array that supports basic arithmetic operations. @@ -84,8 +83,6 @@ 2.0 1.0 Vector((2.0, 1.0)) """ -from __future__ import print_function - import itertools import operator import traceback diff --git a/mis_builder/report/__init__.py b/mis_builder/report/__init__.py index a26b4ee9a..e9368b8ca 100644 --- a/mis_builder/report/__init__.py +++ b/mis_builder/report/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2014-2015 ACSONE SA/NV () # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). diff --git a/mis_builder/report/mis_report_instance_qweb.py b/mis_builder/report/mis_report_instance_qweb.py index c7e4cdce0..ccabd428f 100644 --- a/mis_builder/report/mis_report_instance_qweb.py +++ b/mis_builder/report/mis_report_instance_qweb.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2014-2017 ACSONE SA/NV () # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). @@ -10,15 +9,15 @@ class Report(models.Model): - _inherit = "report" + _inherit = "ir.actions.report" - @api.model - def get_pdf(self, docids, report_name, html=None, data=None): + @api.multi + def render_qweb_pdf(self, res_ids=None, data=None): ctx = self.env.context.copy() - if docids: - report = self._get_report_from_name(report_name) - obj = self.env[report.model].browse(docids)[0] + if res_ids: + obj = self.env[self.model].browse(res_ids)[0] if hasattr(obj, 'landscape_pdf') and obj.landscape_pdf: ctx.update({'landscape': True}) - return super(Report, self.with_context(ctx)).get_pdf( - docids, report_name, html=html, data=data) + return super(Report, self.with_context(ctx)).render_qweb_pdf( + res_ids, data + ) diff --git a/mis_builder/report/mis_report_instance_qweb.xml b/mis_builder/report/mis_report_instance_qweb.xml index 39cb87c64..28616630b 100644 --- a/mis_builder/report/mis_report_instance_qweb.xml +++ b/mis_builder/report/mis_report_instance_qweb.xml @@ -1,16 +1,15 @@ - + MIS report instance QWEB PDF report mis.report.instance - ir.actions.report.xml + ir.actions.report mis_builder.report_mis_report_instance qweb-pdf - -