RemiFr82
2 years ago
34 changed files with 988 additions and 678 deletions
-
60survey_custom_matrix/__manifest__.py
-
2survey_custom_matrix/controllers/__init__.py
-
78survey_custom_matrix/controllers/main.py
-
146survey_custom_matrix/controllers/survey.py
-
18survey_custom_matrix/models/survey_label.py
-
2survey_custom_matrix/models/survey_label_value.py
-
16survey_custom_matrix/models/survey_question.py
-
177survey_custom_matrix/models/survey_user_input_line.py
-
59survey_deadline_autoclose/__manifest__.py
-
4survey_deadline_autoclose/data/ir_cron.xml
-
4survey_deadline_autoclose/i18n/fr.po
-
73survey_deadline_autoclose/models/survey_survey.py
-
2survey_deadline_autoclose/views/survey_survey.xml
-
57survey_description/__manifest__.py
-
2survey_description/i18n/fr.po
-
61survey_input_attachment/__manifest__.py
-
24survey_input_attachment/i18n/fr.po
-
28survey_input_attachment/models/survey_question.py
-
84survey_input_attachment/models/survey_user_input_line.py
-
55survey_input_dates/__manifest__.py
-
12survey_input_dates/i18n/fr.po
-
42survey_input_dates/models/survey_user_input.py
-
3survey_input_dates/views/survey_user_input.xml
-
55survey_input_odoo_debrand/__manifest__.py
-
63survey_input_template_custom/__manifest__.py
-
55survey_link_input_ratio/__manifest__.py
-
88survey_link_input_ratio/models/survey_survey.py
-
24survey_link_input_ratio/views/survey_survey.xml
-
57survey_partner_input/__manifest__.py
-
92survey_partner_input/models/res_partner.py
-
55survey_question_duplicate/__manifest__.py
-
57survey_select_input/__manifest__.py
-
55survey_template/__manifest__.py
-
56survey_template/models/survey_survey.py
@ -1,28 +1,42 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). |
|||
{ |
|||
'name': "Survey custom matrix", |
|||
'version': '1.0', |
|||
'summary': 'This app allows handling of complex survey forms with options like multiple choice questions, custom matrix etc.', |
|||
'description': """ |
|||
Custom Matrix Survey. |
|||
================================ |
|||
"name": "Survey Custom Matrix", |
|||
"version": "1.0.0", |
|||
"summary": """ |
|||
This app allows handling of complex survey forms with options like multiple choice questions, custom matrix etc. |
|||
""", |
|||
'license': 'OPL-1', |
|||
'author': "Kanak Infosystems LLP.", |
|||
'website': "http://www.kanakinfosystems.com", |
|||
'images': ['static/description/banner.jpg'], |
|||
'category': 'Website', |
|||
'depends': ['survey'], |
|||
'data': [ |
|||
'security/ir_model_access.xml', |
|||
'templates/matrix.xml', |
|||
'reports/user_input.xml', |
|||
'views/survey_question.xml', |
|||
'views/survey_user_input.xml', |
|||
'views/survey_user_input_line.xml', |
|||
"description": """ """, |
|||
"author": "RemiFr82", |
|||
"contributors": "", |
|||
"website": "https://remifr82.me", |
|||
"license": "LGPL-3", |
|||
"category": "Marketing", |
|||
# "price": 0, |
|||
# "currency": "EUR", |
|||
"application": False, |
|||
"installable": True, |
|||
"auto_install": False, |
|||
"pre_init_hook": "", |
|||
"post_init_hook": "", |
|||
"uninstall_hook": "", |
|||
"excludes": [], |
|||
"external_dependencies": [], |
|||
"depends": [ |
|||
"survey", |
|||
], |
|||
'application': True, |
|||
# 'price': 49, |
|||
# 'currency': 'EUR', |
|||
"data": [ |
|||
"security/ir_model_access.xml", |
|||
"templates/matrix.xml", |
|||
"reports/user_input.xml", |
|||
"views/survey_question.xml", |
|||
"views/survey_user_input.xml", |
|||
"views/survey_user_input_line.xml", |
|||
], |
|||
"css": [], |
|||
"images": [], |
|||
"js": [], |
|||
"test": [], |
|||
"demo": [], |
|||
"maintainer": "RemiFr82", |
|||
} |
@ -1,2 +1,2 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from . import main |
|||
from . import survey |
@ -1,78 +0,0 @@ |
|||
# -*- coding: utf-8 -*- |
|||
import json |
|||
from odoo import http |
|||
from odoo.http import request |
|||
from odoo.addons.survey.controllers.main import Survey |
|||
|
|||
import logging |
|||
_logger = logging.getLogger(__name__) |
|||
|
|||
|
|||
class Survey(Survey): |
|||
|
|||
@http.route([ |
|||
'/survey/prefill/<model("survey.survey"):survey>/<string:token>', |
|||
'/survey/prefill/<model("survey.survey"):survey>/<string:token>/<model("survey.page"):page>'], |
|||
type='http', auth='public', website=True) |
|||
def prefill(self, survey, token, page=None, **post): |
|||
UserInputLine = request.env['survey.user_input_line'] |
|||
ret = {} |
|||
# Fetch previous answers |
|||
if page: |
|||
previous_answers = UserInputLine.sudo().search([('user_input_id.token', '=', token), ('page_id', '=', page.id)]) |
|||
else: |
|||
previous_answers = UserInputLine.sudo().search([('user_input_id.token', '=', token)]) |
|||
# Return non empty answers in a JSON compatible format |
|||
for answer in previous_answers: |
|||
if not answer.skipped: |
|||
answer_tag = '%s_%s_%s' % (answer.survey_id.id, answer.page_id.id, answer.question_id.id) |
|||
answer_value = None |
|||
if answer.question_id.matrix_subtype == 'custom': |
|||
if answer.answer_type == 'free_text': |
|||
answer_tag = "%s_%s_%s" % (answer_tag, answer.value_suggested_row.id, answer.value_suggested.id) |
|||
answer_value = answer.value_free_text |
|||
elif answer.answer_type == 'text': |
|||
answer_tag = "%s_%s_%s" % (answer_tag, answer.value_suggested_row.id, answer.value_suggested.id) |
|||
answer_value = answer.value_text |
|||
elif answer.answer_type == 'number': |
|||
answer_tag = "%s_%s_%s" % (answer_tag, answer.value_suggested_row.id, answer.value_suggested.id) |
|||
answer_value = str(answer.value_number) |
|||
elif answer.answer_type == 'date': |
|||
answer_tag = "%s_%s_%s" % (answer_tag, answer.value_suggested_row.id, answer.value_suggested.id) |
|||
answer_value = answer.value_date |
|||
elif answer.answer_type == 'dropdown': |
|||
answer_tag = "%s_%s_%s" % (answer_tag, answer.value_suggested_row.id, answer.value_suggested.id) |
|||
answer_value = answer.value_id.id |
|||
elif answer.answer_type == 'suggestion' and not answer.value_suggested_row: |
|||
answer_tag = "%s_%s_%s" % (answer_tag, answer.value_suggested_row.id, answer.value_suggested.id) |
|||
answer_value = answer.value_suggested.id |
|||
elif answer.answer_type == 'suggestion' and answer.value_suggested_row: |
|||
answer_tag = "%s_%s_%s" % (answer_tag, answer.value_suggested_row.id, answer.value_suggested.id) |
|||
answer_value = answer.value_suggested.id |
|||
if answer_value: |
|||
ret.setdefault(answer_tag, []).append(answer_value) |
|||
else: |
|||
_logger.warning("[survey] No answer has been found for question %s marked as non skipped" % answer_tag) |
|||
else: |
|||
if answer.answer_type == 'free_text': |
|||
answer_value = answer.value_free_text |
|||
elif answer.answer_type == 'text' and answer.question_id.type == 'textbox': |
|||
answer_value = answer.value_text |
|||
elif answer.answer_type == 'text' and answer.question_id.type != 'textbox': |
|||
# here come comment answers for matrices, simple choice and multiple choice |
|||
answer_tag = "%s_%s" % (answer_tag, 'comment') |
|||
answer_value = answer.value_text |
|||
elif answer.answer_type == 'number': |
|||
answer_value = str(answer.value_number) |
|||
elif answer.answer_type == 'date': |
|||
answer_value = answer.value_date |
|||
elif answer.answer_type == 'suggestion' and not answer.value_suggested_row: |
|||
answer_value = answer.value_suggested.id |
|||
elif answer.answer_type == 'suggestion' and answer.value_suggested_row: |
|||
answer_tag = "%s_%s" % (answer_tag, answer.value_suggested_row.id) |
|||
answer_value = answer.value_suggested.id |
|||
if answer_value: |
|||
ret.setdefault(answer_tag, []).append(answer_value) |
|||
else: |
|||
_logger.warning("[survey] No answer has been found for question %s marked as non skipped" % answer_tag) |
|||
return json.dumps(ret) |
@ -0,0 +1,146 @@ |
|||
# -*- coding: utf-8 -*- |
|||
import json |
|||
from odoo import http |
|||
from odoo.http import request |
|||
from odoo.addons.survey.controllers.main import Survey |
|||
|
|||
import logging |
|||
|
|||
_logger = logging.getLogger(__name__) |
|||
|
|||
|
|||
class Survey(Survey): |
|||
@http.route( |
|||
[ |
|||
'/survey/prefill/<model("survey.survey"):survey>/<string:token>', |
|||
'/survey/prefill/<model("survey.survey"):survey>/<string:token>/<model("survey.page"):page>', |
|||
], |
|||
type="http", |
|||
auth="public", |
|||
website=True, |
|||
) |
|||
def prefill(self, survey, token, page=None, **post): |
|||
UserInputLine = request.env["survey.user_input_line"] |
|||
ret = {} |
|||
# Fetch previous answers |
|||
if page: |
|||
previous_answers = UserInputLine.sudo().search( |
|||
[("user_input_id.token", "=", token), ("page_id", "=", page.id)] |
|||
) |
|||
else: |
|||
previous_answers = UserInputLine.sudo().search( |
|||
[("user_input_id.token", "=", token)] |
|||
) |
|||
# Return non empty answers in a JSON compatible format |
|||
for answer in previous_answers: |
|||
if not answer.skipped: |
|||
answer_tag = "%s_%s_%s" % ( |
|||
answer.survey_id.id, |
|||
answer.page_id.id, |
|||
answer.question_id.id, |
|||
) |
|||
answer_value = None |
|||
if answer.question_id.matrix_subtype == "custom": |
|||
if answer.answer_type == "free_text": |
|||
answer_tag = "%s_%s_%s" % ( |
|||
answer_tag, |
|||
answer.value_suggested_row.id, |
|||
answer.value_suggested.id, |
|||
) |
|||
answer_value = answer.value_free_text |
|||
elif answer.answer_type == "text": |
|||
answer_tag = "%s_%s_%s" % ( |
|||
answer_tag, |
|||
answer.value_suggested_row.id, |
|||
answer.value_suggested.id, |
|||
) |
|||
answer_value = answer.value_text |
|||
elif answer.answer_type == "number": |
|||
answer_tag = "%s_%s_%s" % ( |
|||
answer_tag, |
|||
answer.value_suggested_row.id, |
|||
answer.value_suggested.id, |
|||
) |
|||
answer_value = str(answer.value_number) |
|||
elif answer.answer_type == "date": |
|||
answer_tag = "%s_%s_%s" % ( |
|||
answer_tag, |
|||
answer.value_suggested_row.id, |
|||
answer.value_suggested.id, |
|||
) |
|||
answer_value = answer.value_date |
|||
elif answer.answer_type == "dropdown": |
|||
answer_tag = "%s_%s_%s" % ( |
|||
answer_tag, |
|||
answer.value_suggested_row.id, |
|||
answer.value_suggested.id, |
|||
) |
|||
answer_value = answer.value_id.id |
|||
elif ( |
|||
answer.answer_type == "suggestion" |
|||
and not answer.value_suggested_row |
|||
): |
|||
answer_tag = "%s_%s_%s" % ( |
|||
answer_tag, |
|||
answer.value_suggested_row.id, |
|||
answer.value_suggested.id, |
|||
) |
|||
answer_value = answer.value_suggested.id |
|||
elif ( |
|||
answer.answer_type == "suggestion" |
|||
and answer.value_suggested_row |
|||
): |
|||
answer_tag = "%s_%s_%s" % ( |
|||
answer_tag, |
|||
answer.value_suggested_row.id, |
|||
answer.value_suggested.id, |
|||
) |
|||
answer_value = answer.value_suggested.id |
|||
if answer_value: |
|||
ret.setdefault(answer_tag, []).append(answer_value) |
|||
else: |
|||
_logger.warning( |
|||
"[survey] No answer has been found for question %s marked as non skipped" |
|||
% answer_tag |
|||
) |
|||
else: |
|||
if answer.answer_type == "free_text": |
|||
answer_value = answer.value_free_text |
|||
elif ( |
|||
answer.answer_type == "text" |
|||
and answer.question_id.type == "textbox" |
|||
): |
|||
answer_value = answer.value_text |
|||
elif ( |
|||
answer.answer_type == "text" |
|||
and answer.question_id.type != "textbox" |
|||
): |
|||
# here come comment answers for matrices, simple choice and multiple choice |
|||
answer_tag = "%s_%s" % (answer_tag, "comment") |
|||
answer_value = answer.value_text |
|||
elif answer.answer_type == "number": |
|||
answer_value = str(answer.value_number) |
|||
elif answer.answer_type == "date": |
|||
answer_value = answer.value_date |
|||
elif ( |
|||
answer.answer_type == "suggestion" |
|||
and not answer.value_suggested_row |
|||
): |
|||
answer_value = answer.value_suggested.id |
|||
elif ( |
|||
answer.answer_type == "suggestion" |
|||
and answer.value_suggested_row |
|||
): |
|||
answer_tag = "%s_%s" % ( |
|||
answer_tag, |
|||
answer.value_suggested_row.id, |
|||
) |
|||
answer_value = answer.value_suggested.id |
|||
if answer_value: |
|||
ret.setdefault(answer_tag, []).append(answer_value) |
|||
else: |
|||
_logger.warning( |
|||
"[survey] No answer has been found for question %s marked as non skipped" |
|||
% answer_tag |
|||
) |
|||
return json.dumps(ret) |
@ -1,34 +1,39 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). |
|||
{ |
|||
'name': 'Auto-close survey on deadline', |
|||
'version': '1.0.0', |
|||
'summary': """ |
|||
"name": "Auto-close survey on deadline", |
|||
"version": "1.0.0", |
|||
"summary": """ |
|||
The module adds a deadline date on surveys and a checkbox to automatically close them with a planned action. |
|||
""", |
|||
'description': """ """, |
|||
'author': 'Sudokeys', |
|||
'website': 'http://www.sudokeys.com', |
|||
'license': 'AGPL-3', |
|||
'category': 'Marketing', |
|||
'depends': [ |
|||
'survey', |
|||
"description": """ """, |
|||
"author": "RemiFr82", |
|||
"contributors": "", |
|||
"website": "https://remifr82.me", |
|||
"license": "LGPL-3", |
|||
"category": "Marketing", |
|||
# "price": 0, |
|||
# "currency": "EUR", |
|||
"application": False, |
|||
"installable": True, |
|||
"auto_install": False, |
|||
"pre_init_hook": "", |
|||
"post_init_hook": "", |
|||
"uninstall_hook": "", |
|||
"excludes": [], |
|||
"external_dependencies": [], |
|||
"depends": [ |
|||
"survey", |
|||
], |
|||
'data': [ |
|||
'data/ir_cron.xml', |
|||
'data/mail_message_subtype.xml', |
|||
'views/survey_survey.xml', |
|||
"data": [ |
|||
"data/ir_cron.xml", |
|||
"data/mail_message_subtype.xml", |
|||
"views/survey_survey.xml", |
|||
], |
|||
'demo': [], |
|||
'auto_install': False, |
|||
'external_dependencies': [], |
|||
'application': False, |
|||
'css': [], |
|||
'images': [], |
|||
'js': [], |
|||
'installable': True, |
|||
'maintainer': 'Sudokeys', |
|||
'pre_init_hook': '', |
|||
'post_init_hook': '', |
|||
'uninstall_hook': '', |
|||
"css": [], |
|||
"images": [], |
|||
"js": [], |
|||
"test": [], |
|||
"demo": [], |
|||
"maintainer": "RemiFr82", |
|||
} |
@ -1,33 +1,38 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). |
|||
{ |
|||
'name': 'Survey description', |
|||
'version': '1.0.0', |
|||
'summary': """ |
|||
"name": "Survey description", |
|||
"version": "1.0.0", |
|||
"summary": """ |
|||
This module displays standard HTML fields \"Description\" and \"Thank you message\" on survey and survey pages. |
|||
""", |
|||
'description': """ """, |
|||
'author': 'Sudokeys', |
|||
'website': 'http://www.sudokeys.com', |
|||
'license': 'AGPL-3', |
|||
'category': 'Marketing', |
|||
'depends': [ |
|||
'survey', |
|||
"description": """ """, |
|||
"author": "RemiFr82", |
|||
"contributors": "", |
|||
"website": "https://remifr82.me", |
|||
"license": "LGPL-3", |
|||
"category": "Marketing", |
|||
# "price": 0, |
|||
# "currency": "EUR", |
|||
"application": False, |
|||
"installable": True, |
|||
"auto_install": False, |
|||
"pre_init_hook": "", |
|||
"post_init_hook": "", |
|||
"uninstall_hook": "", |
|||
"excludes": [], |
|||
"external_dependencies": [], |
|||
"depends": [ |
|||
"survey", |
|||
], |
|||
'data': [ |
|||
'views/survey_page.xml', |
|||
'views/survey_survey.xml', |
|||
"data": [ |
|||
"views/survey_page.xml", |
|||
"views/survey_survey.xml", |
|||
], |
|||
'demo': [], |
|||
'auto_install': False, |
|||
'external_dependencies': [], |
|||
'application': False, |
|||
'css': [], |
|||
'images': [], |
|||
'js': [], |
|||
'installable': True, |
|||
'maintainer': 'Sudokeys', |
|||
'pre_init_hook': '', |
|||
'post_init_hook': '', |
|||
'uninstall_hook': '', |
|||
"css": [], |
|||
"images": [], |
|||
"js": [], |
|||
"test": [], |
|||
"demo": [], |
|||
"maintainer": "RemiFr82", |
|||
} |
@ -1,35 +1,40 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). |
|||
{ |
|||
'name': 'Survey input attachment', |
|||
'version': '1.0.0', |
|||
'summary': """ |
|||
"name": "Survey input attachment", |
|||
"version": "1.0.0", |
|||
"summary": """ |
|||
This module provides a new type of question in surveys, that allows to join a file as answer. |
|||
""", |
|||
'description': """ """, |
|||
'author': 'Sudokeys', |
|||
'website': 'http://www.sudokeys.com/', |
|||
'license': 'AGPL-3', |
|||
'category': 'Marketing', |
|||
'depends': [ |
|||
'survey', |
|||
"description": """ """, |
|||
"author": "RemiFr82", |
|||
"contributors": "", |
|||
"website": "https://remifr82.me", |
|||
"license": "LGPL-3", |
|||
"category": "Marketing", |
|||
# "price": 0, |
|||
# "currency": "EUR", |
|||
"application": False, |
|||
"installable": True, |
|||
"auto_install": False, |
|||
"pre_init_hook": "", |
|||
"post_init_hook": "", |
|||
"uninstall_hook": "", |
|||
"excludes": [], |
|||
"external_dependencies": [], |
|||
"depends": [ |
|||
"survey", |
|||
], |
|||
'data': [ |
|||
'templates/upload_file.xml', |
|||
'templates/page.xml', |
|||
'templates/survey_print.xml', |
|||
'views/survey_user_input_line.xml', |
|||
"data": [ |
|||
"templates/upload_file.xml", |
|||
"templates/page.xml", |
|||
"templates/survey_print.xml", |
|||
"views/survey_user_input_line.xml", |
|||
], |
|||
'demo': [], |
|||
'auto_install': False, |
|||
'external_dependencies': [], |
|||
'application': False, |
|||
'css': [], |
|||
'images': ['static/description/survey.jpg'], |
|||
'js': [], |
|||
'installable': True, |
|||
'maintainer': 'Sudokeys', |
|||
'pre_init_hook': '', |
|||
'post_init_hook': '', |
|||
'uninstall_hook': '', |
|||
"css": [], |
|||
"images": [], |
|||
"js": [], |
|||
"test": [], |
|||
"demo": [], |
|||
"maintainer": "RemiFr82", |
|||
} |
@ -1,32 +1,37 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). |
|||
{ |
|||
'name': 'Survey input dates', |
|||
'version': '1.0.0', |
|||
'summary': """ |
|||
"name": "Survey input dates", |
|||
"version": "1.0.0", |
|||
"summary": """ |
|||
This module adds date start and date done on surveys answers. |
|||
""", |
|||
'description': """ """, |
|||
'author': 'Sudokeys', |
|||
'website': 'http://www.sudokeys.com', |
|||
'license': 'AGPL-3', |
|||
'category': 'Marketing', |
|||
'depends': [ |
|||
'survey', |
|||
"description": """ """, |
|||
"author": "RemiFr82", |
|||
"contributors": "", |
|||
"website": "https://remifr82.me", |
|||
"license": "LGPL-3", |
|||
"category": "Marketing", |
|||
# "price": 0, |
|||
# "currency": "EUR", |
|||
"application": False, |
|||
"installable": True, |
|||
"auto_install": False, |
|||
"pre_init_hook": "", |
|||
"post_init_hook": "", |
|||
"uninstall_hook": "", |
|||
"excludes": [], |
|||
"external_dependencies": [], |
|||
"depends": [ |
|||
"survey", |
|||
], |
|||
'data': [ |
|||
'views/survey_user_input.xml', |
|||
"data": [ |
|||
"views/survey_user_input.xml", |
|||
], |
|||
'demo': [], |
|||
'auto_install': False, |
|||
'external_dependencies': [], |
|||
'application': False, |
|||
'css': [], |
|||
'images': [], |
|||
'js': [], |
|||
'installable': True, |
|||
'maintainer': 'Sudokeys', |
|||
'pre_init_hook': '', |
|||
'post_init_hook': '', |
|||
'uninstall_hook': '', |
|||
"css": [], |
|||
"images": [], |
|||
"js": [], |
|||
"test": [], |
|||
"demo": [], |
|||
"maintainer": "RemiFr82", |
|||
} |
@ -1,16 +1,42 @@ |
|||
from odoo import models, fields, api |
|||
from odoo import models, fields, api, _ |
|||
|
|||
|
|||
class SurveyUserInput(models.Model): |
|||
_inherit = 'survey.user_input' |
|||
_inherit = "survey.user_input" |
|||
|
|||
date_start = fields.Datetime(string="Start date", readonly=True, help="This date is set when the user clicks on \"Start survey\" button for the first time.") |
|||
date_done = fields.Datetime(string="Date done", readonly=True, help="This date is set when the user input is set ton \"Done\" status.") |
|||
date_start = fields.Datetime( |
|||
string="Start date", |
|||
readonly=True, |
|||
help='This date is set when the user clicks on "Start survey" button for the first time.', |
|||
) |
|||
date_done = fields.Datetime( |
|||
string="Date done", |
|||
readonly=True, |
|||
help='This date is set when the user input is set ton "Done" status.', |
|||
) |
|||
duration = fields.Integer( |
|||
string="Duration", |
|||
compute="_get_duration", |
|||
store=True, |
|||
help="Time expressed in seconds, neet 'duration' widget to be read by user.", |
|||
) |
|||
|
|||
@api.depends("date_start", "date_stop") |
|||
def _get_duration(self): |
|||
for input in self: |
|||
start = input.date_start |
|||
done = input.date_done |
|||
if not start and done: |
|||
input.duration = 0 |
|||
else: |
|||
input.duration = int((done - start).total_seconds()) |
|||
|
|||
@api.multi |
|||
def write(self, vals): |
|||
if vals.get('state', False) == 'done': |
|||
vals.update({ |
|||
'date_done': fields.Datetime.now(), |
|||
}) |
|||
if vals.get("state", False) == "done": |
|||
vals.update( |
|||
{ |
|||
"date_done": fields.Datetime.now(), |
|||
} |
|||
) |
|||
return super(SurveyUserInput, self).write(vals) |
@ -1,32 +1,37 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). |
|||
{ |
|||
'name': 'Survey input debranding', |
|||
'version': '1.0.0', |
|||
'summary': """ |
|||
"name": "Survey input debranding", |
|||
"version": "1.0.0", |
|||
"summary": """ |
|||
This module removes the \"Create a free website with odoo\" mention at the bottom right of survey inputs. |
|||
""", |
|||
'description': """ """, |
|||
'author': 'Sudokeys', |
|||
'website': 'http://www.sudokeys.com', |
|||
'license': 'AGPL-3', |
|||
'category': 'Marketing', |
|||
'depends': [ |
|||
'survey', |
|||
"description": """ """, |
|||
"author": "RemiFr82", |
|||
"contributors": "", |
|||
"website": "https://remifr82.me", |
|||
"license": "LGPL-3", |
|||
"category": "Marketing", |
|||
# "price": 0, |
|||
# "currency": "EUR", |
|||
"application": False, |
|||
"installable": True, |
|||
"auto_install": False, |
|||
"pre_init_hook": "", |
|||
"post_init_hook": "", |
|||
"uninstall_hook": "", |
|||
"excludes": [], |
|||
"external_dependencies": [], |
|||
"depends": [ |
|||
"survey", |
|||
], |
|||
'data': [ |
|||
'templates/layout.xml', |
|||
"data": [ |
|||
"templates/layout.xml", |
|||
], |
|||
'demo': [], |
|||
'auto_install': False, |
|||
'external_dependencies': [], |
|||
'application': False, |
|||
'css': [], |
|||
'images': [], |
|||
'js': [], |
|||
'installable': True, |
|||
'maintainer': 'Sudokeys', |
|||
'pre_init_hook': '', |
|||
'post_init_hook': '', |
|||
'uninstall_hook': '', |
|||
"css": [], |
|||
"images": [], |
|||
"js": [], |
|||
"test": [], |
|||
"demo": [], |
|||
"maintainer": "RemiFr82", |
|||
} |
@ -1,36 +1,41 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). |
|||
{ |
|||
'name': 'Survey input custom', |
|||
'version': '1.0.0', |
|||
'summary': """ |
|||
"name": "Survey input custom", |
|||
"version": "1.0.0", |
|||
"summary": """ |
|||
This module allows to customize the survey start button label and the \"Thank you\" page title. |
|||
""", |
|||
'description': """ """, |
|||
'author': 'Sudokeys', |
|||
'website': 'http://www.sudokeys.com', |
|||
'license': 'AGPL-3', |
|||
'category': 'Marketing', |
|||
'depends': [ |
|||
'survey_description', |
|||
"description": """ """, |
|||
"author": "RemiFr82", |
|||
"contributors": "", |
|||
"website": "https://remifr82.me", |
|||
"license": "LGPL-3", |
|||
"category": "Marketing", |
|||
# "price": 0, |
|||
# "currency": "EUR", |
|||
"application": False, |
|||
"installable": True, |
|||
"auto_install": False, |
|||
"pre_init_hook": "", |
|||
"post_init_hook": "", |
|||
"uninstall_hook": "", |
|||
"excludes": [], |
|||
"external_dependencies": [], |
|||
"depends": [ |
|||
"survey_description", |
|||
], |
|||
'data': [ |
|||
'templates/layout.xml', |
|||
'templates/page.xml', |
|||
'templates/sfinished.xml', |
|||
'templates/survey_init.xml', |
|||
'views/survey_survey.xml', |
|||
"data": [ |
|||
"templates/layout.xml", |
|||
"templates/page.xml", |
|||
"templates/sfinished.xml", |
|||
"templates/survey_init.xml", |
|||
"views/survey_survey.xml", |
|||
], |
|||
'demo': [], |
|||
'auto_install': False, |
|||
'external_dependencies': [], |
|||
'application': False, |
|||
'css': [], |
|||
'images': [], |
|||
'js': [], |
|||
'installable': True, |
|||
'maintainer': 'Sudokeys', |
|||
'pre_init_hook': '', |
|||
'post_init_hook': '', |
|||
'uninstall_hook': '', |
|||
"css": [], |
|||
"images": [], |
|||
"js": [], |
|||
"test": [], |
|||
"demo": [], |
|||
"maintainer": "RemiFr82", |
|||
} |
@ -1,32 +1,37 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). |
|||
{ |
|||
'name': 'Survey sent answer ratio', |
|||
'version': '1.0.0', |
|||
'summary': """ |
|||
"name": "Survey sent answer ratio", |
|||
"version": "1.0.0", |
|||
"summary": """ |
|||
This module displays percent pies statistics on sent inputs in survey form stat-buttons. |
|||
""", |
|||
'description': """ """, |
|||
'author': 'Sudokeys', |
|||
'website': 'http://www.sudokeys.com', |
|||
'license': 'AGPL-3', |
|||
'category': 'Marketing', |
|||
'depends': [ |
|||
'survey', |
|||
"description": """ """, |
|||
"author": "RemiFr82", |
|||
"contributors": "", |
|||
"website": "https://remifr82.me", |
|||
"license": "LGPL-3", |
|||
"category": "Marketing", |
|||
# "price": 0, |
|||
# "currency": "EUR", |
|||
"application": False, |
|||
"installable": True, |
|||
"auto_install": False, |
|||
"pre_init_hook": "", |
|||
"post_init_hook": "", |
|||
"uninstall_hook": "", |
|||
"excludes": [], |
|||
"external_dependencies": [], |
|||
"depends": [ |
|||
"survey", |
|||
], |
|||
'data': [ |
|||
'views/survey_survey.xml', |
|||
"data": [ |
|||
"views/survey_survey.xml", |
|||
], |
|||
'demo': [], |
|||
'auto_install': False, |
|||
'external_dependencies': [], |
|||
'application': False, |
|||
'css': [], |
|||
'images': [], |
|||
'js': [], |
|||
'installable': True, |
|||
'maintainer': 'Sudokeys', |
|||
'pre_init_hook': '', |
|||
'post_init_hook': '', |
|||
'uninstall_hook': '', |
|||
"css": [], |
|||
"images": [], |
|||
"js": [], |
|||
"test": [], |
|||
"demo": [], |
|||
"maintainer": "RemiFr82", |
|||
} |
@ -1,33 +1,38 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). |
|||
{ |
|||
'name': 'Survey partner answers', |
|||
'version': '1.0.0', |
|||
'summary': """ |
|||
"name": "Survey partner answers", |
|||
"version": "1.0.0", |
|||
"summary": """ |
|||
This module displays a counter and a percent pie on partner survey answers statistics in form stat-buttons. |
|||
""", |
|||
'description': """ """, |
|||
'author': 'Sudokeys', |
|||
'website': 'http://www.sudokeys.com', |
|||
'license': 'AGPL-3', |
|||
'category': 'Marketing', |
|||
'depends': [ |
|||
'survey', |
|||
"description": """ """, |
|||
"author": "RemiFr82", |
|||
"contributors": "", |
|||
"website": "https://remifr82.me", |
|||
"license": "LGPL-3", |
|||
"category": "Marketing", |
|||
# "price": 0, |
|||
# "currency": "EUR", |
|||
"application": False, |
|||
"installable": True, |
|||
"auto_install": False, |
|||
"pre_init_hook": "", |
|||
"post_init_hook": "", |
|||
"uninstall_hook": "", |
|||
"excludes": [], |
|||
"external_dependencies": [], |
|||
"depends": [ |
|||
"survey", |
|||
], |
|||
'data': [ |
|||
'views/res_partner.xml', |
|||
'views/survey_user_input.xml', |
|||
"data": [ |
|||
"views/res_partner.xml", |
|||
"views/survey_user_input.xml", |
|||
], |
|||
'demo': [], |
|||
'auto_install': False, |
|||
'external_dependencies': [], |
|||
'application': False, |
|||
'css': [], |
|||
'images': [], |
|||
'js': [], |
|||
'installable': True, |
|||
'maintainer': 'Sudokeys', |
|||
'pre_init_hook': '', |
|||
'post_init_hook': '', |
|||
'uninstall_hook': '', |
|||
"css": [], |
|||
"images": [], |
|||
"js": [], |
|||
"test": [], |
|||
"demo": [], |
|||
"maintainer": "RemiFr82", |
|||
} |
@ -1,32 +1,37 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). |
|||
{ |
|||
'name': 'Survey question duplicate', |
|||
'version': '1.0.0', |
|||
'summary': """ |
|||
"name": "Survey question duplicate", |
|||
"version": "1.0.0", |
|||
"summary": """ |
|||
This module adds a \"Copy\" button in question lines on survey page form, only in edit mode. |
|||
""", |
|||
'description': """ """, |
|||
'author': 'Sudokeys', |
|||
'website': 'http://www.sudokeys.com/', |
|||
'license': 'AGPL-3', |
|||
'category': 'Marketing', |
|||
'depends': [ |
|||
'survey', |
|||
"description": """ """, |
|||
"author": "RemiFr82", |
|||
"contributors": "", |
|||
"website": "https://remifr82.me", |
|||
"license": "LGPL-3", |
|||
"category": "Marketing", |
|||
# "price": 0, |
|||
# "currency": "EUR", |
|||
"application": False, |
|||
"installable": True, |
|||
"auto_install": False, |
|||
"pre_init_hook": "", |
|||
"post_init_hook": "", |
|||
"uninstall_hook": "", |
|||
"excludes": [], |
|||
"external_dependencies": [], |
|||
"depends": [ |
|||
"survey", |
|||
], |
|||
'data': [ |
|||
'views/survey_page.xml', |
|||
"data": [ |
|||
"views/survey_page.xml", |
|||
], |
|||
'demo': [], |
|||
'auto_install': False, |
|||
'external_dependencies': [], |
|||
'application': False, |
|||
'css': [], |
|||
'images': ['static/description/survey.jpg'], |
|||
'js': [], |
|||
'installable': True, |
|||
'maintainer': 'Sudokeys', |
|||
'pre_init_hook': '', |
|||
'post_init_hook': '', |
|||
'uninstall_hook': '', |
|||
"css": [], |
|||
"images": [], |
|||
"js": [], |
|||
"test": [], |
|||
"demo": [], |
|||
"maintainer": "RemiFr82", |
|||
} |
@ -1,33 +1,38 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). |
|||
{ |
|||
'name': 'Survey answer selection', |
|||
'version': '1.0.0', |
|||
'summary': """ |
|||
"name": "Survey answer selection", |
|||
"version": "1.0.0", |
|||
"summary": """ |
|||
This module adds the mossibility to select some of the surveys answers. |
|||
""", |
|||
'description': """ """, |
|||
'author': 'Sudokeys', |
|||
'website': 'http://www.sudokeys.com', |
|||
'license': 'AGPL-3', |
|||
'category': 'Marketing', |
|||
'depends': [ |
|||
'survey', |
|||
"description": """ """, |
|||
"author": "RemiFr82", |
|||
"contributors": "", |
|||
"website": "https://remifr82.me", |
|||
"license": "LGPL-3", |
|||
"category": "Marketing", |
|||
# "price": 0, |
|||
# "currency": "EUR", |
|||
"application": False, |
|||
"installable": True, |
|||
"auto_install": False, |
|||
"pre_init_hook": "", |
|||
"post_init_hook": "", |
|||
"uninstall_hook": "", |
|||
"excludes": [], |
|||
"external_dependencies": [], |
|||
"depends": [ |
|||
"survey", |
|||
], |
|||
'data': [ |
|||
'views/survey_survey.xml', |
|||
'views/survey_user_input.xml', |
|||
"data": [ |
|||
"views/survey_survey.xml", |
|||
"views/survey_user_input.xml", |
|||
], |
|||
'demo': [], |
|||
'auto_install': False, |
|||
'external_dependencies': [], |
|||
'application': False, |
|||
'css': [], |
|||
'images': [], |
|||
'js': [], |
|||
'installable': True, |
|||
'maintainer': 'Sudokeys', |
|||
'pre_init_hook': '', |
|||
'post_init_hook': '', |
|||
'uninstall_hook': '', |
|||
"css": [], |
|||
"images": [], |
|||
"js": [], |
|||
"test": [], |
|||
"demo": [], |
|||
"maintainer": "RemiFr82", |
|||
} |
@ -1,32 +1,37 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). |
|||
{ |
|||
'name': 'Survey template', |
|||
'version': '1.0.0', |
|||
'summary': """ |
|||
"name": "Survey template", |
|||
"version": "1.0.0", |
|||
"summary": """ |
|||
This module adds templating feature on surveys and their own menu item. |
|||
""", |
|||
'description': """ """, |
|||
'author': 'Sudokeys', |
|||
'website': 'http://www.sudokeys.com', |
|||
'license': 'AGPL-3', |
|||
'category': 'Marketing', |
|||
'depends': [ |
|||
'survey', |
|||
"description": """ """, |
|||
"author": "RemiFr82", |
|||
"contributors": "", |
|||
"website": "https://remifr82.me", |
|||
"license": "LGPL-3", |
|||
"category": "Marketing", |
|||
# "price": 0, |
|||
# "currency": "EUR", |
|||
"application": False, |
|||
"installable": True, |
|||
"auto_install": False, |
|||
"pre_init_hook": "", |
|||
"post_init_hook": "", |
|||
"uninstall_hook": "", |
|||
"excludes": [], |
|||
"external_dependencies": [], |
|||
"depends": [ |
|||
"survey", |
|||
], |
|||
'data': [ |
|||
'views/survey_survey.xml', |
|||
"data": [ |
|||
"views/survey_survey.xml", |
|||
], |
|||
'demo': [], |
|||
'auto_install': False, |
|||
'external_dependencies': [], |
|||
'application': False, |
|||
'css': [], |
|||
'images': [], |
|||
'js': [], |
|||
'installable': True, |
|||
'maintainer': 'Sudokeys', |
|||
'pre_init_hook': '', |
|||
'post_init_hook': '', |
|||
'uninstall_hook': '', |
|||
"css": [], |
|||
"images": [], |
|||
"js": [], |
|||
"test": [], |
|||
"demo": [], |
|||
"maintainer": "RemiFr82", |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue