From ec463918038d11f72e06b7ac00fb9f995395d27c Mon Sep 17 00:00:00 2001 From: Edilio Escalona Almira Date: Fri, 6 Mar 2026 18:18:26 -0500 Subject: [PATCH] [FIX] survey_certification_branding: Correcting the design of the survey certificates --- .pre-commit-config.yaml | 6 ++-- survey_certification_branding/README.rst | 9 ++---- survey_certification_branding/__manifest__.py | 5 ++++ .../models/survey_survey.py | 2 ++ .../readme/CONTRIBUTORS.md | 1 + .../report/survey_report_templates.xml | 16 +++++----- .../static/description/index.html | 29 ++++++++----------- .../static/src/scss/survey_reports.scss | 27 +++++++++++++++++ .../test_survey_certification_branding.py | 4 +-- 9 files changed, 62 insertions(+), 37 deletions(-) create mode 100644 survey_certification_branding/static/src/scss/survey_reports.scss diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 768100b4..df58351e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -105,7 +105,7 @@ repos: - "eslint@8.24.0" - "eslint-plugin-jsdoc@" - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v6.0.0 hooks: - id: trailing-whitespace # exclude autogenerated files @@ -114,8 +114,6 @@ repos: # exclude autogenerated files exclude: /README\.rst$|\.pot?$ - id: debug-statements - - id: fix-encoding-pragma - args: ["--remove"] - id: check-case-conflict - id: check-docstring-first - id: check-executables-have-shebangs @@ -140,7 +138,7 @@ repos: - --settings=. exclude: /__init__\.py$ - repo: https://github.com/acsone/setuptools-odoo - rev: 3.1.8 + rev: 3.3.2 hooks: - id: setuptools-odoo-make-default - id: setuptools-odoo-get-requirements diff --git a/survey_certification_branding/README.rst b/survey_certification_branding/README.rst index 37de98d7..e33cde23 100644 --- a/survey_certification_branding/README.rst +++ b/survey_certification_branding/README.rst @@ -1,7 +1,3 @@ -.. image:: https://odoo-community.org/readme-banner-image - :target: https://odoo-community.org/get-involved?utm_source=readme - :alt: Odoo Community Association - ============================= Survey Certification Branding ============================= @@ -11,13 +7,13 @@ Survey Certification Branding !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:bf66d7d6f1763ed45d7a781496e429c7b5fce2685a87639351e12799e946e56d + !! source digest: sha256:cb5073b1693cdbdc0f6c7d106d6301dd238b3e20156702e9e029fb14f5e7985f !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |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/license-AGPL--3-blue.png +.. |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%2Fsurvey-lightgray.png?logo=github @@ -85,6 +81,7 @@ Contributors ------------ - Rolando Pérez Rebollo r.perez@binhex.cloud (https://binhex.cloud) +- Edilio Escalona Almira e.escalona@binhex.cloud (https://binhex.cloud) Maintainers ----------- diff --git a/survey_certification_branding/__manifest__.py b/survey_certification_branding/__manifest__.py index 8df66059..40ec100c 100644 --- a/survey_certification_branding/__manifest__.py +++ b/survey_certification_branding/__manifest__.py @@ -16,4 +16,9 @@ "views/survey_survey_views.xml", "report/survey_report_templates.xml", ], + "assets": { + "web.report_assets_common": [ + "survey_certification_branding/static/src/scss/survey_reports.scss", + ], + }, } diff --git a/survey_certification_branding/models/survey_survey.py b/survey_certification_branding/models/survey_survey.py index dcc504cc..f11290ea 100644 --- a/survey_certification_branding/models/survey_survey.py +++ b/survey_certification_branding/models/survey_survey.py @@ -7,6 +7,7 @@ class SurveySurvey(models.Model): _inherit = "survey.survey" + title = fields.Char(size=180) certification_company_name = fields.Char( "Certification - Company Name", help=( @@ -15,6 +16,7 @@ class SurveySurvey(models.Model): ), compute="_compute_certification_branding_fields", store=True, + size=100, readonly=False, ) diff --git a/survey_certification_branding/readme/CONTRIBUTORS.md b/survey_certification_branding/readme/CONTRIBUTORS.md index 9868bc73..9cd3271c 100644 --- a/survey_certification_branding/readme/CONTRIBUTORS.md +++ b/survey_certification_branding/readme/CONTRIBUTORS.md @@ -1 +1,2 @@ - Rolando Pérez Rebollo (https://binhex.cloud) +- Edilio Escalona Almira (https://binhex.cloud) diff --git a/survey_certification_branding/report/survey_report_templates.xml b/survey_certification_branding/report/survey_report_templates.xml index 515a5e70..acb255fb 100644 --- a/survey_certification_branding/report/survey_report_templates.xml +++ b/survey_certification_branding/report/survey_report_templates.xml @@ -35,10 +35,10 @@ - @@ -80,10 +80,10 @@ - diff --git a/survey_certification_branding/static/description/index.html b/survey_certification_branding/static/description/index.html index 78145bae..6f2a017d 100644 --- a/survey_certification_branding/static/description/index.html +++ b/survey_certification_branding/static/description/index.html @@ -3,7 +3,7 @@ -README.rst +Survey Certification Branding -
+
+

Survey Certification Branding

- - -Odoo Community Association - -
-

Survey Certification Branding

-

Beta License: AGPL-3 OCA/survey Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/survey Translate me on Weblate Try me on Runboat

This module extends the functionality of survey to support customization of certification reports. Specifically, it enables:

    @@ -398,7 +393,7 @@

    Survey Certification Branding

-

Usage

+

Usage

  1. Go to the Surveys app.
  2. Open an existing survey or create a new one.
  3. @@ -412,7 +407,7 @@

    Usage

    Certification Branding Section

-

Bug Tracker

+

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 to smash it by providing a detailed and welcomed @@ -420,21 +415,22 @@

Bug Tracker

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

-
diff --git a/survey_certification_branding/static/src/scss/survey_reports.scss b/survey_certification_branding/static/src/scss/survey_reports.scss new file mode 100644 index 00000000..79387804 --- /dev/null +++ b/survey_certification_branding/static/src/scss/survey_reports.scss @@ -0,0 +1,27 @@ +#o_survey_certification.certification-wrapper { + .certification { + .certification-bottom { + bottom: 0 !important; + } + } + + // Modern Template + &.modern { + .certification { + .certification-top { + padding-bottom: 2mm !important; + } + } + } + + &.classic { + .certification-bottom { + .certification-number { + bottom: 0 !important; + } + .certification-seal { + top: 45% !important; + } + } + } +} diff --git a/survey_certification_branding/tests/test_survey_certification_branding.py b/survey_certification_branding/tests/test_survey_certification_branding.py index d42e7746..d52c28c7 100644 --- a/survey_certification_branding/tests/test_survey_certification_branding.py +++ b/survey_certification_branding/tests/test_survey_certification_branding.py @@ -25,10 +25,10 @@ def _assert_report_rendering(self, user_input): certification = user_input.survey_id if certification.certification: self.assertIn(self.certification_company_name, res) - self.assertIn("certification_logo_512", res) + self.assertIn("certification-branding", res) else: self.assertNotIn(self.certification_company_name, res) - self.assertNotIn("certification_logo_512", res) + self.assertNotIn("certification-branding", res) def test_branding_fields_flow_and_certification_report_rendering(self): with self.with_user("survey_user"):