Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
9 changes: 3 additions & 6 deletions survey_certification_branding/README.rst
Original file line number Diff line number Diff line change
@@ -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
=============================
Expand All @@ -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
Comment on lines -20 to +16

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The license badge was changed from license to licence. OCA consistently uses license in badges, and the README is autogenerated, so this change should be reverted or applied in the readme source instead.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @atgalvez08 , that's how the pre-commit generates it; perhaps it's a missing configuration. @pedrobaeza , could you comment on this? Thanks

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because the README template that uses ocabot is not the repository one, but a custom fixed one, provoking this problem. @sbidoul is finally the template included in the latest oca-addons-repo-template?

: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
Expand Down Expand Up @@ -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
-----------
Expand Down
5 changes: 5 additions & 0 deletions survey_certification_branding/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
},
}
2 changes: 2 additions & 0 deletions survey_certification_branding/models/survey_survey.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=(
Expand All @@ -15,6 +16,7 @@ class SurveySurvey(models.Model):
),
compute="_compute_certification_branding_fields",
store=True,
size=100,
readonly=False,
)

Expand Down
1 change: 1 addition & 0 deletions survey_certification_branding/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
- Rolando Pérez Rebollo <r.perez@binhex.cloud> (https://binhex.cloud)
- Edilio Escalona Almira <e.escalona@binhex.cloud> (https://binhex.cloud)
16 changes: 8 additions & 8 deletions survey_certification_branding/report/survey_report_templates.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
</xpath>
<xpath expr="//span[@t-field='user_input.env.company.logo']" position="after">
<t t-else="">
<span
class="certification-company-logo"
t-field="user_input.survey_id.certification_logo_512"
t-options="{'widget': 'image'}"
<img
class="certification-company-logo certification-branding"
t-att-src="image_data_uri(user_input.survey_id.certification_logo_512)"
style="max-height: 100px;"
role="img"
/>
</t>
Expand Down Expand Up @@ -80,10 +80,10 @@
</xpath>
<xpath expr="//span[@t-field='user_input.env.company.logo']" position="after">
<t t-else="">
<span
class="certification-company-logo"
t-field="user_input.survey_id.certification_logo_512"
t-options="{'widget': 'image'}"
<img
class="certification-company-logo certification-branding"
t-att-src="image_data_uri(user_input.survey_id.certification_logo_512)"
style="max-height: 100px;"
role="img"
/>
</t>
Expand Down
29 changes: 12 additions & 17 deletions survey_certification_branding/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>README.rst</title>
<title>Survey Certification Branding</title>
<style type="text/css">

/*
Expand Down Expand Up @@ -360,21 +360,16 @@
</style>
</head>
<body>
<div class="document">
<div class="document" id="survey-certification-branding">
<h1 class="title">Survey Certification Branding</h1>


<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
</a>
<div class="section" id="survey-certification-branding">
<h1>Survey Certification Branding</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:bf66d7d6f1763ed45d7a781496e429c7b5fce2685a87639351e12799e946e56d
!! source digest: sha256:cb5073b1693cdbdc0f6c7d106d6301dd238b3e20156702e9e029fb14f5e7985f
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/survey/tree/16.0/survey_certification_branding"><img alt="OCA/survey" src="https://img.shields.io/badge/github-OCA%2Fsurvey-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/survey-16-0/survey-16-0-survey_certification_branding"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/survey&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/survey/tree/16.0/survey_certification_branding"><img alt="OCA/survey" src="https://img.shields.io/badge/github-OCA%2Fsurvey-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/survey-16-0/survey-16-0-survey_certification_branding"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/survey&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module extends the functionality of survey to support customization
of certification reports. Specifically, it enables:</p>
<ul class="simple">
Expand All @@ -398,7 +393,7 @@ <h1>Survey Certification Branding</h1>
</ul>
</div>
<div class="section" id="usage">
<h2><a class="toc-backref" href="#toc-entry-1">Usage</a></h2>
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<ol class="arabic simple">
<li>Go to the <strong>Surveys</strong> app.</li>
<li>Open an existing survey or create a new one.</li>
Expand All @@ -412,29 +407,30 @@ <h2><a class="toc-backref" href="#toc-entry-1">Usage</a></h2>
<p><img alt="Certification Branding Section" src="https://raw.githubusercontent.com/OCA/survey/16.0/survey_certification_branding/static/description/certification_branding_section.png" /></p>
</div>
<div class="section" id="bug-tracker">
<h2><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h2>
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/survey/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/survey/issues/new?body=module:%20survey_certification_branding%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h2><a class="toc-backref" href="#toc-entry-3">Credits</a></h2>
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
<div class="section" id="authors">
<h3><a class="toc-backref" href="#toc-entry-4">Authors</a></h3>
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
<ul class="simple">
<li>Binhex</li>
</ul>
</div>
<div class="section" id="contributors">
<h3><a class="toc-backref" href="#toc-entry-5">Contributors</a></h3>
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<ul class="simple">
<li>Rolando Pérez Rebollo <a class="reference external" href="mailto:r.perez&#64;binhex.cloud">r.perez&#64;binhex.cloud</a> (<a class="reference external" href="https://binhex.cloud">https://binhex.cloud</a>)</li>
<li>Edilio Escalona Almira <a class="reference external" href="mailto:e.escalona&#64;binhex.cloud">e.escalona&#64;binhex.cloud</a> (<a class="reference external" href="https://binhex.cloud">https://binhex.cloud</a>)</li>
</ul>
</div>
<div class="section" id="maintainers">
<h3><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h3>
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
Expand All @@ -447,6 +443,5 @@ <h3><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h3>
</div>
</div>
</div>
</div>
</body>
</html>
27 changes: 27 additions & 0 deletions survey_certification_branding/static/src/scss/survey_reports.scss
Original file line number Diff line number Diff line change
@@ -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;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down