From 1468fb323790cdb712d7945c0e6dcd49c7b1afc0 Mon Sep 17 00:00:00 2001 From: Iryna Vyshnevska Date: Thu, 30 Dec 2021 10:58:06 +0200 Subject: [PATCH] [14.0][MIG] report_layout_config --- report_layout_config/__manifest__.py | 2 +- .../models/base_document_layout.py | 16 +------------- .../templates/report_templates.xml | 22 +------------------ .../views/document_layout.xml | 7 +----- .../odoo/addons/report_layout_config | 1 + setup/report_layout_config/setup.py | 6 +++++ 6 files changed, 11 insertions(+), 43 deletions(-) create mode 120000 setup/report_layout_config/odoo/addons/report_layout_config create mode 100644 setup/report_layout_config/setup.py diff --git a/report_layout_config/__manifest__.py b/report_layout_config/__manifest__.py index b87609451..e27c0401e 100644 --- a/report_layout_config/__manifest__.py +++ b/report_layout_config/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Report layout configuration", "summary": "Add possibility to easily modify the global report layout", - "version": "13.0.1.0.1", + "version": "14.0.1.0.0", "category": "Reporting", "website": "https://github.com/OCA/reporting-engine", "author": "Camptocamp, " "Odoo Community Association (OCA)", diff --git a/report_layout_config/models/base_document_layout.py b/report_layout_config/models/base_document_layout.py index f2579cc77..387ce0ba4 100644 --- a/report_layout_config/models/base_document_layout.py +++ b/report_layout_config/models/base_document_layout.py @@ -25,22 +25,8 @@ class BaseDocumentLayout(models.TransientModel): self.need_images_layout = self.external_report_layout_id == img_lay @api.depends( - "report_layout_id", - "logo", - "font", - "primary_color", - "secondary_color", "full_footer_img", "full_header_img", ) def _compute_preview(self): - self.ensure_one() - if not self.need_images_layout or not self.report_layout_id: - super()._compute_preview() - else: - ir_qweb = self.env["ir.qweb"] - qweb_ctx = self.env["ir.ui.view"]._prepare_qcontext() - qweb_ctx.update({"company": self}) - self.preview = ir_qweb.render( - "report_layout_config.layout_preview", qweb_ctx - ) + super()._compute_preview() diff --git a/report_layout_config/templates/report_templates.xml b/report_layout_config/templates/report_templates.xml index e3f142b63..e9665acd0 100644 --- a/report_layout_config/templates/report_templates.xml +++ b/report_layout_config/templates/report_templates.xml @@ -85,25 +85,5 @@ /> - - - - + diff --git a/report_layout_config/views/document_layout.xml b/report_layout_config/views/document_layout.xml index 07e4609d9..8900c36c7 100644 --- a/report_layout_config/views/document_layout.xml +++ b/report_layout_config/views/document_layout.xml @@ -3,7 +3,7 @@ base.document.layout base.document.layout - + {'invisible': [('need_images_layout', '=', True)]} - - {'invisible': [('need_images_layout', '=', True)]} -