Skip to content

Commit

Permalink
Merge PR #106 into 15.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Jan 16, 2024
2 parents 5b17547 + 30f8571 commit 365c9d0
Show file tree
Hide file tree
Showing 21 changed files with 753 additions and 0 deletions.
1 change: 1 addition & 0 deletions setup/survey_skip_start/odoo/addons/survey_skip_start
6 changes: 6 additions & 0 deletions setup/survey_skip_start/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
113 changes: 113 additions & 0 deletions survey_skip_start/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
=================
Survey Skip Start
=================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:2fcfa0f62dcc2455eb925c373fb343703fe10b2f4c258a862e574c364703c10a
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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%2Fsurvey-lightgray.png?logo=github
:target: https://github.com/OCA/survey/tree/15.0/survey_skip_start
:alt: OCA/survey
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/survey-15-0/survey-15-0-survey_skip_start
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/survey&target_branch=15.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows to configure a survey to lead the users directly to
fill the form skipping the start screen.

**Table of contents**

.. contents::
:local:

Use Cases / Context
===================

Normally the screen start doesn't provide much value in regular surveys.

Configuration
=============

If you want to skip the start screen for a survey:

1. Go to *Surveys > Surveys* and choose the survey you want to
configure.
2. Go to the *Options* tab and in the *Questions* section set the *Skip
start screen* option on.

Usage
=====

Go to a survey which has the *Skip start screen* option set and you'll
be leaded directly to the form.

Known issues / Roadmap
======================

- For the moment, it only works with one page layouts.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/survey/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
`feedback <https://github.com/OCA/survey/issues/new?body=module:%20survey_skip_start%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
-------

* Tecnativa

Contributors
------------

- `Tecnativa <https://www.tecnativa.com>`__

- David Vidal

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.

.. |maintainer-chienandalu| image:: https://github.com/chienandalu.png?size=40px
:target: https://github.com/chienandalu
:alt: chienandalu

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-chienandalu|

This module is part of the `OCA/survey <https://github.com/OCA/survey/tree/15.0/survey_skip_start>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions survey_skip_start/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import controllers
from . import models
23 changes: 23 additions & 0 deletions survey_skip_start/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2024 Tecnativa - David Vidal
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Survey Skip Start",
"summary": "Skip the surveys start screen and go directly to fill the form",
"version": "15.0.1.0.0",
"development_status": "Beta",
"category": "Marketing/Survey",
"website": "https://github.com/OCA/survey",
"author": "Tecnativa, Odoo Community Association (OCA)",
"maintainers": ["chienandalu"],
"license": "AGPL-3",
"depends": ["survey"],
"data": [
"views/survey_survey_views.xml",
"views/survey_templates.xml",
],
"assets": {
"web.assets_tests": [
"/survey_skip_start/static/tests/survey_skip_start_tour.esm.js",
],
},
}
1 change: 1 addition & 0 deletions survey_skip_start/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import main
10 changes: 10 additions & 0 deletions survey_skip_start/controllers/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright 2024 Tecnativa - David Vidal
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo.addons.survey.controllers.main import Survey


class Survey(Survey):
def _prepare_survey_data(self, survey_sudo, answer_sudo, **post):
survey_data = super()._prepare_survey_data(survey_sudo, answer_sudo, **post)
survey_data["skip_start"] = survey_sudo.skip_start
return survey_data
1 change: 1 addition & 0 deletions survey_skip_start/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import survey_survey
24 changes: 24 additions & 0 deletions survey_skip_start/models/survey_survey.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2024 Tecnativa - David Vidal
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import _, api, fields, models
from odoo.exceptions import UserError


class SurveySurvey(models.Model):
_inherit = "survey.survey"

skip_start = fields.Boolean(
string="Skip start screen",
help="Skip the start screen and go directly to the survey form",
)

@api.constrains("skip_start")
def _constrain_skip_start(self):
"""For the moment, skipping the start screen is only compatible with single
page layout surveys"""
if self.filtered(lambda x: x.skip_start and x.questions_layout != "one_page"):
raise UserError(
_(
"The skip start screen option is only compatible with on page layouts"
)
)
5 changes: 5 additions & 0 deletions survey_skip_start/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
If you want to skip the start screen for a survey:

1. Go to *Surveys > Surveys* and choose the survey you want to configure.
2. Go to the *Options* tab and in the *Questions* section set the *Skip start screen*
option on.
1 change: 1 addition & 0 deletions survey_skip_start/readme/CONTEXT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Normally the screen start doesn't provide much value in regular surveys.
3 changes: 3 additions & 0 deletions survey_skip_start/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- [Tecnativa](https://www.tecnativa.com)

- David Vidal
2 changes: 2 additions & 0 deletions survey_skip_start/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module allows to configure a survey to lead the users directly to fill the form
skipping the start screen.
1 change: 1 addition & 0 deletions survey_skip_start/readme/ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- For the moment, it only works with one page layouts.
2 changes: 2 additions & 0 deletions survey_skip_start/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Go to a survey which has the *Skip start screen* option set and you'll be leaded
directly to the form.
Loading

0 comments on commit 365c9d0

Please sign in to comment.