diff --git a/report_qweb_custom_renderer/README.rst b/report_qweb_custom_renderer/README.rst new file mode 100644 index 0000000000..1360e77942 --- /dev/null +++ b/report_qweb_custom_renderer/README.rst @@ -0,0 +1,83 @@ +===================== +Custom QWEB rendering +===================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github + :target: https://github.com/OCA/reporting-engine/tree/12.0/report_qweb_custom_renderer + :alt: OCA/reporting-engine +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/reporting-engine-12-0/reporting-engine-12-0-report_qweb_custom_renderer + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/143/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module is a base module for other addons that provide a different PDF renderer than Odoo's default wkhtmltopdf. + +**Table of contents** + +.. contents:: + :local: + +Known issues / Roadmap +====================== + +* support attachments + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Therp BV + +Contributors +~~~~~~~~~~~~ + +* Holger Brunn + +Other credits +~~~~~~~~~~~~~ + +* Odoo Community Association: `Icon `_. + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/reporting-engine `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/report_qweb_custom_renderer/__init__.py b/report_qweb_custom_renderer/__init__.py new file mode 100644 index 0000000000..be8574876f --- /dev/null +++ b/report_qweb_custom_renderer/__init__.py @@ -0,0 +1,3 @@ +# Copyright 2018 Therp BV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from . import models diff --git a/report_qweb_custom_renderer/__manifest__.py b/report_qweb_custom_renderer/__manifest__.py new file mode 100644 index 0000000000..e651b8d0e9 --- /dev/null +++ b/report_qweb_custom_renderer/__manifest__.py @@ -0,0 +1,16 @@ +# Copyright 2018 Therp BV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +{ + "name": "Custom QWEB rendering", + "version": "12.0.1.0.0", + "author": "Therp BV,Odoo Community Association (OCA)", + "license": "AGPL-3", + "category": "Hidden/Dependency", + "summary": "Base module for non-wkhtmlpdf report rendering", + "depends": [ + 'base', + ], + "data": [ + "views/ir_actions_report.xml", + ], +} diff --git a/report_qweb_custom_renderer/models/__init__.py b/report_qweb_custom_renderer/models/__init__.py new file mode 100644 index 0000000000..5528969b23 --- /dev/null +++ b/report_qweb_custom_renderer/models/__init__.py @@ -0,0 +1,3 @@ +# Copyright 2018 Therp BV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from . import ir_actions_report diff --git a/report_qweb_custom_renderer/models/ir_actions_report.py b/report_qweb_custom_renderer/models/ir_actions_report.py new file mode 100644 index 0000000000..f8c817c438 --- /dev/null +++ b/report_qweb_custom_renderer/models/ir_actions_report.py @@ -0,0 +1,22 @@ +# Copyright 2018 Therp BV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from odoo import api, fields, models + + +class IrActionsReport(models.Model): + _inherit = 'ir.actions.report' + + qweb_pdf_engine = fields.Selection( + [('wkhtmltopdf', 'wkhtmltopdf')], default='wkhtmltopdf', + string='PDF Engine', + ) + + @api.multi + def render_qweb_pdf(self, res_ids=None, data=None): + if self.qweb_pdf_engine == 'wkhtmltopdf': + return super(IrActionsReport, self).render_qweb_pdf( + res_ids=res_ids, data=data, + ) + return getattr(self, '_render_qweb_pdf_%s' % self.qweb_pdf_engine)( + res_ids=res_ids, data=data, + ) diff --git a/report_qweb_custom_renderer/readme/CONTRIBUTORS.rst b/report_qweb_custom_renderer/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..b120a956f8 --- /dev/null +++ b/report_qweb_custom_renderer/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Holger Brunn diff --git a/report_qweb_custom_renderer/readme/CREDITS.rst b/report_qweb_custom_renderer/readme/CREDITS.rst new file mode 100644 index 0000000000..cc056a80d6 --- /dev/null +++ b/report_qweb_custom_renderer/readme/CREDITS.rst @@ -0,0 +1 @@ +* Odoo Community Association: `Icon `_. diff --git a/report_qweb_custom_renderer/readme/DESCRIPTION.rst b/report_qweb_custom_renderer/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..e1b645af7a --- /dev/null +++ b/report_qweb_custom_renderer/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module is a base module for other addons that provide a different PDF renderer than Odoo's default wkhtmltopdf. diff --git a/report_qweb_custom_renderer/readme/ROADMAP.rst b/report_qweb_custom_renderer/readme/ROADMAP.rst new file mode 100644 index 0000000000..03b5c84b83 --- /dev/null +++ b/report_qweb_custom_renderer/readme/ROADMAP.rst @@ -0,0 +1 @@ +* support attachments diff --git a/report_qweb_custom_renderer/static/description/icon.png b/report_qweb_custom_renderer/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/report_qweb_custom_renderer/static/description/icon.png differ diff --git a/report_qweb_custom_renderer/static/description/index.html b/report_qweb_custom_renderer/static/description/index.html new file mode 100644 index 0000000000..90d24c8489 --- /dev/null +++ b/report_qweb_custom_renderer/static/description/index.html @@ -0,0 +1,411 @@ + + + + + + +Custom QWEB rendering + + + +
+

Custom QWEB rendering

+ + +

Beta License: AGPL-3 OCA/reporting-engine Translate me on Weblate Try me on Runbot

+

This module is a base module for other addons that provide a different PDF renderer than Odoo’s default wkhtmltopdf.

+

Table of contents

+ +
+

Known issues / Roadmap

+
    +
  • support attachments
  • +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Therp BV
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+
    +
  • Odoo Community Association: Icon.
  • +
+
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/reporting-engine project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/report_qweb_custom_renderer/views/ir_actions_report.xml b/report_qweb_custom_renderer/views/ir_actions_report.xml new file mode 100644 index 0000000000..12b9d3cd86 --- /dev/null +++ b/report_qweb_custom_renderer/views/ir_actions_report.xml @@ -0,0 +1,12 @@ + + + + ir.actions.report + + + + + + + +