diff --git a/report_layout_config/README.rst b/report_layout_config/README.rst new file mode 100644 index 000000000..6c46ba656 --- /dev/null +++ b/report_layout_config/README.rst @@ -0,0 +1,82 @@ +=========================== +Report layout configuration +=========================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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/13.0/report_layout_config + :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-13-0/reporting-engine-13-0-report_layout_config + :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/13.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module provides new report template +with possibility to add image to replace header and footer. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +* In Setting/General Setting/Business Documents: + * Click on Configure Document Layout + * On the wizard choose Layout images + * Set the `Full header image` + `Full footer image` + +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 +~~~~~~~ + +* Camptocamp + +Contributors +~~~~~~~~~~~~ + +* Thomas Nowicki + +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_layout_config/__init__.py b/report_layout_config/__init__.py new file mode 100644 index 000000000..9a14fd06d --- /dev/null +++ b/report_layout_config/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2020 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import models diff --git a/report_layout_config/__manifest__.py b/report_layout_config/__manifest__.py new file mode 100644 index 000000000..6524f68fa --- /dev/null +++ b/report_layout_config/__manifest__.py @@ -0,0 +1,21 @@ +# Copyright 2020 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "Report layout configuration", + "summary": "Add possibility to easily modify the global report layout", + "version": "14.0.1.0.0", + "category": "Reporting", + "website": "https://github.com/OCA/reporting-engine", + "author": "Camptocamp, " "Odoo Community Association (OCA)", + "license": "AGPL-3", + "depends": ["web", "base"], + "data": [ + "views/document_layout.xml", + "templates/assets.xml", + "templates/report_templates.xml", + "data/report_layout.xml", + ], + "application": False, + "installable": True, +} diff --git a/report_layout_config/data/report_layout.xml b/report_layout_config/data/report_layout.xml new file mode 100644 index 000000000..1d41271b8 --- /dev/null +++ b/report_layout_config/data/report_layout.xml @@ -0,0 +1,27 @@ + + + + Layout images standard + + /report_layout_config/static/img/preview_standard.png + /report_layout_config/static/pdf/preview_standard.pdf + + + + Layout images clean + + /report_layout_config/static/img/preview_standard.png + /report_layout_config/static/pdf/preview_standard.pdf + + + diff --git a/report_layout_config/i18n/report_layout_config.pot b/report_layout_config/i18n/report_layout_config.pot new file mode 100644 index 000000000..cd3e98a9d --- /dev/null +++ b/report_layout_config/i18n/report_layout_config.pot @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * report_layout_config +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +"&.o_report_layout_standard {\n" +" h2 {\n" +" color:" +msgstr "" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" }\n" +" #informations strong {\n" +" color:" +msgstr "" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" }\n" +" #total strong{\n" +" color:" +msgstr "" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" }\n" +" table {\n" +" thead {\n" +" color:" +msgstr "" + +#. module: report_layout_config +#: model:ir.model,name:report_layout_config.model_res_company +msgid "Companies" +msgstr "" + +#. module: report_layout_config +#: model:ir.model,name:report_layout_config.model_base_document_layout +msgid "Company Document Layout" +msgstr "" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.external_layout_images_template +#: model_terms:ir.ui.view,arch_db:report_layout_config.footer_image +msgid "Footer logo" +msgstr "" + +#. module: report_layout_config +#: model:ir.model.fields,field_description:report_layout_config.field_base_document_layout__full_footer_img +#: model:ir.model.fields,field_description:report_layout_config.field_res_company__full_footer_img +msgid "Full footer image" +msgstr "" + +#. module: report_layout_config +#: model:ir.model.fields,field_description:report_layout_config.field_base_document_layout__full_header_img +#: model:ir.model.fields,field_description:report_layout_config.field_res_company__full_header_img +msgid "Full header image" +msgstr "" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.external_layout_images_template +#: model_terms:ir.ui.view,arch_db:report_layout_config.header_image +msgid "Logo" +msgstr "" + +#. module: report_layout_config +#: model:ir.model.fields,field_description:report_layout_config.field_base_document_layout__need_images_layout +msgid "Need Images Layout" +msgstr "" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.external_layout_images_template +msgid "Page: / " +msgstr "" + +#. module: report_layout_config +#: model:ir.model.fields,help:report_layout_config.field_base_document_layout__full_footer_img +#: model:ir.model.fields,help:report_layout_config.field_res_company__full_footer_img +msgid "This image will replace all footer." +msgstr "" + +#. module: report_layout_config +#: model:ir.model.fields,help:report_layout_config.field_base_document_layout__full_header_img +#: model:ir.model.fields,help:report_layout_config.field_res_company__full_header_img +msgid "This image will replace all header." +msgstr "" diff --git a/report_layout_config/migrations/14.0.1.0.0/pre-migrate.py b/report_layout_config/migrations/14.0.1.0.0/pre-migrate.py new file mode 100644 index 000000000..fd4459fee --- /dev/null +++ b/report_layout_config/migrations/14.0.1.0.0/pre-migrate.py @@ -0,0 +1,18 @@ +# Copyright 2021 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + + +from openupgradelib.openupgrade import rename_xmlids + + +def migrate(cr, version): + + rename_xmlids( + cr, + [ + ( + "report_layout_config.external_layout_images", + "report_layout_config.external_standard_layout_images_template", + ) + ], + ) diff --git a/report_layout_config/models/__init__.py b/report_layout_config/models/__init__.py new file mode 100644 index 000000000..290c7e138 --- /dev/null +++ b/report_layout_config/models/__init__.py @@ -0,0 +1,2 @@ +from . import res_company +from . import base_document_layout diff --git a/report_layout_config/models/base_document_layout.py b/report_layout_config/models/base_document_layout.py new file mode 100644 index 000000000..11a353d1f --- /dev/null +++ b/report_layout_config/models/base_document_layout.py @@ -0,0 +1,26 @@ +# Copyright 2020 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import api, fields, models + + +class BaseDocumentLayout(models.TransientModel): + _inherit = "base.document.layout" + + full_header_img = fields.Binary( + related="company_id.full_header_img", + readonly=False, + help="Replaces whole header with image", + ) + full_footer_img = fields.Binary( + related="company_id.full_footer_img", + readonly=False, + help="Replaces whole footer, disables footer logo", + ) + + @api.depends( + "full_footer_img", + "full_header_img", + ) + def _compute_preview(self): + super()._compute_preview() diff --git a/report_layout_config/models/res_company.py b/report_layout_config/models/res_company.py new file mode 100644 index 000000000..f2ff4f40b --- /dev/null +++ b/report_layout_config/models/res_company.py @@ -0,0 +1,19 @@ +# Copyright 2020 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class ResCompany(models.Model): + _inherit = "res.company" + + full_header_img = fields.Binary( + string="Full header image", + help="This image will replace all header.", + attachment=True, + ) + full_footer_img = fields.Binary( + string="Full footer image", + help="This image will replace all footer.", + attachment=True, + ) diff --git a/report_layout_config/readme/CONTRIBUTORS.rst b/report_layout_config/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..429d07530 --- /dev/null +++ b/report_layout_config/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Thomas Nowicki +* Iryna Vyshnevska diff --git a/report_layout_config/readme/DESCRIPTION.rst b/report_layout_config/readme/DESCRIPTION.rst new file mode 100644 index 000000000..1283e67d0 --- /dev/null +++ b/report_layout_config/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module provides new report template +with possibility to add image to replace header and footer. diff --git a/report_layout_config/readme/USAGE.rst b/report_layout_config/readme/USAGE.rst new file mode 100644 index 000000000..32584e7b9 --- /dev/null +++ b/report_layout_config/readme/USAGE.rst @@ -0,0 +1,4 @@ +* In Setting/General Setting/Business Documents: + * Click on Configure Document Layout + * On the wizard choose Layout images + * Set the `Full header image` + `Full footer image` diff --git a/report_layout_config/static/description/icon.png b/report_layout_config/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/report_layout_config/static/description/icon.png differ diff --git a/report_layout_config/static/description/index.html b/report_layout_config/static/description/index.html new file mode 100644 index 000000000..7e457c7af --- /dev/null +++ b/report_layout_config/static/description/index.html @@ -0,0 +1,436 @@ + + + + + + +Report layout configuration + + + +
+

Report layout configuration

+ + +

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

+

This module provides new report template +with possibility to add image to replace header and footer.

+

Table of contents

+ +
+

Usage

+
    +
  • +
    In Setting/General Setting/Business Documents:
    +
      +
    • Click on Configure Document Layout
    • +
    • On the wizard choose Layout images
    • +
    • Set the Full header image + Full footer image
    • +
    +
    +
    +
  • +
+
+
+

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

+
    +
  • Camptocamp
  • +
+
+ +
+

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_layout_config/static/img/preview_standard.png b/report_layout_config/static/img/preview_standard.png new file mode 100644 index 000000000..0bd596ed9 Binary files /dev/null and b/report_layout_config/static/img/preview_standard.png differ diff --git a/report_layout_config/static/pdf/preview_standard.pdf b/report_layout_config/static/pdf/preview_standard.pdf new file mode 100644 index 000000000..4d5373768 Binary files /dev/null and b/report_layout_config/static/pdf/preview_standard.pdf differ diff --git a/report_layout_config/static/src/scss/style.scss b/report_layout_config/static/src/scss/style.scss new file mode 100644 index 000000000..bc9b9350f --- /dev/null +++ b/report_layout_config/static/src/scss/style.scss @@ -0,0 +1,11 @@ +.footer-image { + max-width: 500px; +} + +.header-image { + margin-top: 22px; +} + +.header-full-image { + max-height: 60px; +} diff --git a/report_layout_config/templates/assets.xml b/report_layout_config/templates/assets.xml new file mode 100644 index 000000000..e27fd9d89 --- /dev/null +++ b/report_layout_config/templates/assets.xml @@ -0,0 +1,14 @@ + + + + + + diff --git a/report_layout_config/templates/report_templates.xml b/report_layout_config/templates/report_templates.xml new file mode 100644 index 000000000..d10909717 --- /dev/null +++ b/report_layout_config/templates/report_templates.xml @@ -0,0 +1,152 @@ + + + + + + + + + diff --git a/report_layout_config/views/document_layout.xml b/report_layout_config/views/document_layout.xml new file mode 100644 index 000000000..d03e0432c --- /dev/null +++ b/report_layout_config/views/document_layout.xml @@ -0,0 +1,17 @@ + + + + base.document.layout + base.document.layout + + + + + + + + max-width: 450px; + + + + diff --git a/setup/report_layout_config/odoo/addons/report_layout_config b/setup/report_layout_config/odoo/addons/report_layout_config new file mode 120000 index 000000000..8ebf5e6e2 --- /dev/null +++ b/setup/report_layout_config/odoo/addons/report_layout_config @@ -0,0 +1 @@ +../../../../report_layout_config \ No newline at end of file diff --git a/setup/report_layout_config/setup.py b/setup/report_layout_config/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/report_layout_config/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)