Compare commits

...

8 Commits
12.0 ... 16.0

  1. 2
      survey_custom_matrix/__manifest__.py
  2. 13
      survey_deadline_autoclose/__manifest__.py
  3. 5
      survey_deadline_autoclose/data/ir_cron.xml
  4. 15
      survey_deadline_autoclose/data/mail_message_subtype.xml
  5. 114
      survey_deadline_autoclose/i18n/fr.po
  6. 96
      survey_deadline_autoclose/models/survey_survey.py
  7. 85
      survey_deadline_autoclose/views/survey_survey.xml
  8. 0
      survey_description/__init__.py
  9. 34
      survey_description/i18n/fr.po
  10. 19
      survey_description/views/survey_page.xml
  11. 29
      survey_description/views/survey_survey.xml
  12. 2
      survey_input_attachment/__manifest__.py
  13. 71
      survey_input_dates/i18n/fr.po
  14. 14
      survey_input_dates/models/survey_survey.py
  15. 55
      survey_input_dates/models/survey_user_input.py
  16. 65
      survey_input_dates/views/survey_user_input.xml
  17. 0
      survey_input_duration/__init__.py
  18. 12
      survey_input_duration/__manifest__.py
  19. 36
      survey_input_duration/i18n/fr.po
  20. 1
      survey_input_duration/models/__init__.py
  21. 22
      survey_input_duration/models/survey_user_input.py
  22. 58
      survey_input_duration/views/survey_user_input.xml
  23. 2
      survey_input_odoo_debrand/__manifest__.py
  24. 2
      survey_input_template_custom/__manifest__.py
  25. 2
      survey_link_input_ratio/__manifest__.py
  26. 0
      survey_page_duplicate/__init__.py
  27. 39
      survey_page_duplicate/__manifest__.py
  28. 22
      survey_page_duplicate/i18n/fr.po
  29. 16
      survey_page_duplicate/views/survey_survey.xml
  30. 14
      survey_partner_input/i18n/fr.po
  31. 43
      survey_partner_input/models/res_partner.py
  32. 10
      survey_partner_input/views/res_partner.xml
  33. 4
      survey_partner_input/views/survey_user_input.xml
  34. 1
      survey_pass_fail_messages/__init__.py
  35. 12
      survey_pass_fail_messages/__manifest__.py
  36. 77
      survey_pass_fail_messages/i18n/fr.po
  37. 1
      survey_pass_fail_messages/models/__init__.py
  38. 17
      survey_pass_fail_messages/models/survey_survey.py
  39. 25
      survey_pass_fail_messages/views/survey_survey.xml
  40. 15
      survey_pass_fail_messages/views/survey_templates.xml
  41. 2
      survey_question_duplicate/__manifest__.py
  42. 2
      survey_select_input/__manifest__.py
  43. 2
      survey_template/__manifest__.py

2
survey_custom_matrix/__manifest__.py

@ -17,7 +17,7 @@
# "price": 0,
# "currency": "EUR",
"application": False,
"installable": True,
"installable": False,
"auto_install": False,
"pre_init_hook": "",
"post_init_hook": "",

13
survey_deadline_autoclose/__manifest__.py

@ -1,19 +1,20 @@
# -*- coding: utf-8 -*-
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
{
"name": "Auto-close survey on deadline",
"name": "Close survey on deadline",
"version": "1.0.0",
"summary": """
Deadline date on surveys and auto-close option
Add deadline date on surveys to auto-close them.
""",
"description": """
This module adds a deadline date on surveys and a checkbox to automatically close them with a planned action.""",
This module adds a deadline date on surveys and a cron task to close them when this date is passed.""",
"author": "RemiFr82",
"contributors": "Sudokeys",
"contributors": "",
"maintainer": "RemiFr82",
"website": "https://remifr82.me",
"license": "LGPL-3",
"category": "Marketing",
# "price": 0,
# "price": 5.0,
# "currency": "EUR",
"application": False,
"installable": True,
@ -31,10 +32,10 @@
"data/mail_message_subtype.xml",
"views/survey_survey.xml",
],
"assets": {},
"css": [],
"images": [],
"js": [],
"test": [],
"demo": [],
"maintainer": "RemiFr82",
}

5
survey_deadline_autoclose/data/ir_cron.xml

@ -1,18 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<!-- <data> -->
<record model="ir.cron" id="cron_close_expired_surveys">
<field name="name">Close expired surveys</field>
<field name="model_id" ref="survey.model_survey_survey" />
<field name="state">code</field>
<field name="code">model.with_context(cron=True).cron_close_deadline_survey()</field>
<field name="code">model.with_context(cron=True).cron_close_passed_deadline_survey()</field>
<field name="active" eval="True" />
<field name="user_id" ref="base.user_root" />
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="nextcall" eval="(datetime.today() + relativedelta(days=1)).strftime('%Y-%m-%d 00:08:00')"/>
<field name="nextcall" eval="(datetime.today() + relativedelta(days=1)).strftime('%Y-%m-%d 00:00:00')" />
<field name="numbercall">-1</field>
<field name="doall" eval="False" />
</record>

15
survey_deadline_autoclose/data/mail_message_subtype.xml

@ -2,22 +2,13 @@
<odoo>
<data noupdate="1">
<record id="mail_message_subtype_survey_expired" model="mail.message.subtype">
<field name="name">Expired survey</field>
<record id="mail_message_subtype_survey_closing" model="mail.message.subtype">
<field name="name">Closing</field>
<field name="res_model">survey.survey</field>
<field name="default" eval="True" />
<field name="hidden" eval="False" />
<field name='internal' eval="True" />
<field name="description">This survey has expired.</field>
</record>
<record id="mail_message_subtype_survey_closed" model="mail.message.subtype">
<field name="name">Closed survey</field>
<field name="res_model">survey.survey</field>
<field name="default" eval="True"/>
<field name="hidden" eval="False"/>
<field name='internal' eval="True"/>
<field name="description">This survey is closed.</field>
<field name="description">Survey closing</field>
</record>
</data>

114
survey_deadline_autoclose/i18n/fr.po

@ -4,81 +4,63 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Project-Id-Version: Odoo Server 16.0-20230613\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-02-28 18:13+0000\n"
"PO-Revision-Date: 2023-02-28 18:13+0000\n"
"Last-Translator: <>\n"
"POT-Creation-Date: 2024-12-28 17:42+0000\n"
"PO-Revision-Date: 2024-12-28 17:42+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: survey_deadline_autoclose
#: model_terms:ir.ui.view,arch_db:survey_deadline_autoclose.survey_survey_view_kanban
msgid ""
"#{record.auto_close.raw_value ? 'Survey will be automatically closed once "
"deadline passed' : ''}"
msgstr ""
"#{record.auto_close.raw_value ? 'Le sondage sera automatiquement fermé une "
"fois échu' : ''}"
#. module: survey_deadline_autoclose
#: model:ir.model.fields,field_description:survey_deadline_autoclose.field_survey_survey__active
msgid "Active"
msgstr "Actif"
#. module: survey_deadline_autoclose
#: model:ir.model.fields,field_description:survey_deadline_autoclose.field_survey_survey__auto_close
msgid "Auto close"
msgstr "Clôture automatique"
msgid "Auto closing"
msgstr "Clôture auto"
#. module: survey_deadline_autoclose
#: model:mail.message.subtype,description:survey_deadline_autoclose.mail_message_subtype_survey_closed
msgid "This survey is closed."
msgstr "Ce sondage est clôturé."
#: model_terms:ir.ui.view,arch_db:survey_deadline_autoclose.survey_survey_view_form
msgid "Automatic closing ?"
msgstr "Clôture auto ?"
#. module: survey_deadline_autoclose
#: model:ir.actions.server,name:survey_deadline_autoclose.cron_close_expired_surveys_ir_actions_server
#: model:ir.cron,cron_name:survey_deadline_autoclose.cron_close_expired_surveys
#: model:ir.cron,name:survey_deadline_autoclose.cron_close_expired_surveys
msgid "Close expired surveys"
msgstr "Clôture des sondages arrivés à échéance"
msgstr "Fermeture des sondages échus"
#. module: survey_deadline_autoclose
#: model_terms:ir.ui.view,arch_db:survey_deadline_autoclose.survey_survey_form
msgid "Close survey"
msgstr "Clôturer ce sondage"
#: model:mail.message.subtype,name:survey_deadline_autoclose.mail_message_subtype_survey_closing
msgid "Closing"
msgstr "Fermeture"
#. module: survey_deadline_autoclose
#: model:mail.message.subtype,name:survey_deadline_autoclose.mail_message_subtype_survey_closed
msgid "Closed survey"
msgstr "Sondage clos"
#. module: survey_deadline_autoclose
#: model:ir.model.fields,field_description:survey_deadline_autoclose.field_survey_survey__date_deadline
#: model:ir.model.fields,field_description:survey_deadline_autoclose.field_survey_survey__deadline
#: model_terms:ir.ui.view,arch_db:survey_deadline_autoclose.survey_survey_view_kanban
#: model_terms:ir.ui.view,arch_db:survey_deadline_autoclose.survey_survey_view_search
msgid "Deadline"
msgstr "Echéance"
#. module: survey_deadline_autoclose
#: model_terms:ir.ui.view,arch_db:survey_deadline_autoclose.survey_survey_kanban
msgid "Expiration :"
msgstr "Échéance :"
#. module: survey_deadline_autoclose
#: model_terms:ir.ui.view,arch_db:survey_deadline_autoclose.survey_survey_search
msgid "Expiration month"
msgstr "Mois d'échéance"
#. module: survey_deadline_autoclose
#: model:mail.message.subtype,name:survey_deadline_autoclose.mail_message_subtype_survey_expired
msgid "Expired survey"
msgstr "Sondage expiré"
#. module: survey_deadline_autoclose
#: model_terms:ir.ui.view,arch_db:survey_deadline_autoclose.survey_survey_search
msgid "Group By"
msgstr "Regrouper par"
msgstr "Échéance"
#. module: survey_deadline_autoclose
#: model:ir.model.fields,help:survey_deadline_autoclose.field_survey_survey__auto_close
msgid "If checked, the survey will be automatically closed when deadline is overpassed."
msgstr "Si coché, ce sondage sera automatiquement clôturé lorsque la date d'échéance sera dépassée."
#. module: survey_deadline_autoclose
#: code:addons/survey_deadline_autoclose/models/survey_survey.py:65
#, python-format
msgid "No \"closed\" stage found, the requested operation is impossible.\n"
"To fix this situation, you have to check \"Closed\" at least on one survey stage."
msgstr "Aucune étape \"Fermé\" trouvée, l'opération demandée est impossible.\n"
"Pour régler ce problème, vous devez cocher \"Fermé\" sur au moins une étape."
msgid "If checked, this survey will be automatically closed after the deadline."
msgstr "Si coché, ce sondage sera automatiquement clos après échéance."
#. module: survey_deadline_autoclose
#: model:ir.model,name:survey_deadline_autoclose.model_survey_survey
@ -86,29 +68,11 @@ msgid "Survey"
msgstr "Sondage"
#. module: survey_deadline_autoclose
#: code:addons/survey_deadline_autoclose/models/survey_survey.py:56
#, python-format
msgid "Survey closing impossible"
msgstr "Clôture du sondage impossible"
#: model:mail.message.subtype,description:survey_deadline_autoclose.mail_message_subtype_survey_closing
msgid "Survey closing"
msgstr "Clôture"
#. module: survey_deadline_autoclose
#: code:addons/survey_deadline_autoclose/models/survey_survey.py:57
#, python-format
msgid "Survey should have been automatically closed but no \"closed\" stage was found, the requested operation was impossible to proceed.\n"
"To fix this situation, you have to check \"Closed\" at least on one survey stage."
msgstr "Ce sondage aurait dû être clôturé automatiquement mais aucune étape \"Fermé\" n'a été trouvée, l'opération demandée est impossible.\n"
"Pour régler ce problème, vous devez cocher \"Fermée\" sur au moins une étape."
#. module: survey_deadline_autoclose
#: code:addons/survey_deadline_autoclose/models/survey_survey.py:22
#: model:mail.message.subtype,description:survey_deadline_autoclose.mail_message_subtype_survey_expired
#, python-format
msgid "This survey has expired."
msgstr "Ce sondage est arrivé à échéance."
#. module: survey_deadline_autoclose
#: code:addons/survey_deadline_autoclose/models/survey_survey.py:75
#, python-format
msgid "This survey was automatically closed."
msgstr "Ce sondage a été clôturé automatiquement."
#: model:ir.model.fields,help:survey_deadline_autoclose.field_survey_survey__deadline
msgid "The day after date at 00:00 will be set as default answer deadline on survey sharing."
msgstr "Le lendemain de cette date à 00:00 sera utilisé comme échéance de réponse lors du partage du sondage."

96
survey_deadline_autoclose/models/survey_survey.py

@ -1,86 +1,62 @@
from odoo import models, fields, api, _
from odoo.exceptions import UserError
from datetime import timedelta
from pytz import timezone, utc
from odoo import models, fields, api
class SurveySurvey(models.Model):
_inherit = "survey.survey"
@api.model
def cron_close_deadline_survey(self):
deadline = self.search(
def cron_close_passed_deadline_survey(self):
to_close = self.search(
[
("date_deadline", "!=", False),
("date_deadline", "<", fields.Date.today()),
("deadline", "!=", False),
("deadline", "<", fields.Date.today()),
("auto_close", "=", True),
]
)
to_close = deadline.filtered("auto_close")
if to_close:
to_close.action_close_survey()
for survey in deadline - to_close:
survey.message_post(
subtype="survey_deadline_autoclose.mail_message_subtype_survey_deadline",
body=_("This survey has expired."),
)
to_close.action_archive()
date_deadline = fields.Date(
string="Deadline", copy=False, track_visibility="onchange"
deadline = fields.Date(
string="Deadline",
copy=False,
tracking=True,
help="The day after date at 00:00 will be set as default answer deadline on survey sharing.",
)
auto_close = fields.Boolean(
string="Auto close",
default=False,
help="If checked, the survey will be automatically closed when deadline is overpassed.",
track_visibility="onchange",
string="Auto closing",
help="If checked, this survey will be automatically closed after the deadline.",
)
active = fields.Boolean(
tracking=True,
)
# ACTIONS
@api.multi
def action_send_survey(self):
self.ensure_one()
action = super(SurveySurvey, self).action_send_survey()
action["context"].update(
{
"default_date_deadline": self.date_deadline,
"default_deadline": timezone(self.env.user.tz)
.localize(
fields.Datetime.to_datetime(fields.Date.to_string(self.deadline))
+ timedelta(days=1)
)
.astimezone(utc),
}
)
return action
@api.multi
def action_close_survey(self):
stage = self.env["survey.stage"].search([("closed", "=", True)], limit=1)
if not stage:
if self.env.context.get("cron", False):
for survey in self:
survey.message_post(
subtype="survey_deadline_autoclose.mail_message_subtype_survey_closed",
subject=_("Survey closing impossible"),
body=_(
'Survey should have been automatically closed but no "closed" '
"stage was found, the requested operation was impossible to proceed.\n"
'To fix this situation, you have to check "Closed" at least on one survey stage.'
),
)
else:
raise UserError(
_(
'No "closed" stage found, the requested operation is impossible.\n'
'To fix this situation, you have to check "Closed" at least on one survey stage.'
)
)
else:
self.write({"stage_id": stage.id})
for survey in self:
survey.message_post(
subtype="survey_deadline_autoclose.mail_message_subtype_survey_closed",
body=_("This survey was automatically closed."),
)
# ONCHANGES
@api.onchange("date_deadline")
def onchange_date_deadline(self):
@api.onchange("deadline")
def onchange_deadline(self):
self.ensure_one()
if not self.date_deadline:
if not self.deadline and self.auto_close:
self.auto_close = False
elif not self.auto_close:
self.auto_close = True
def _track_subtype(self, init_values):
self.ensure_one()
if "active" in init_values:
return self.env.ref(
"survey_deadline_autoclose.mail_message_subtype_survey_closing"
)
return super(SurveySurvey, self)._track_subtype(init_values)

85
survey_deadline_autoclose/views/survey_survey.xml

@ -1,80 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="survey_survey_form" model="ir.ui.view">
<field name="name">survey_deadline_autoclose survey.survey form</field>
<record id="survey_survey_view_form" model="ir.ui.view">
<field name="name">survey_deadline_autoclose form</field>
<field name="model">survey.survey</field>
<field name="inherit_id" ref="survey.survey_form"/>
<field name="inherit_id" ref="survey.survey_survey_view_form" />
<field name="priority">28</field>
<field name="arch" type="xml">
<field name="stage_id" position="before">
<button name="action_close_survey" string="Close survey" type="object" attrs="{'invisible': [('is_closed', '=', True)]}"/>
<field name="scoring_type" position="before">
<label for="deadline" />
<div class="o_row">
<field name="deadline" class="oe_inline" />
<label for="auto_close" string="Automatic closing ?" attrs="{'invisible': [('deadline', '=', False)]}" />
<field name="auto_close" attrs="{'invisible': [('deadline', '=', False)]}" />
</div>
</field>
<xpath expr="//field[@name='users_can_go_back']/../.." position="inside">
<group name="options">
</group>
</xpath>
<group name="options" position="inside">
<xpath expr="//field[@name='users_can_go_back']/.." position="move"/>
</group>
<group name="options" position="inside">
<group name="deadline" class="o_label_nowrap">
<field name="date_deadline" class="oe_inline"/>
<field name="auto_close" attrs="{'invisible': [('date_deadline','=',False)]}"/>
</group>
</group>
</field>
</record>
<record id="survey_survey_tree" model="ir.ui.view">
<field name="name">survey_deadline_autoclose survey.survey tree</field>
<record id="survey_survey_view_tree" model="ir.ui.view">
<field name="name">survey_deadline_autoclose tree</field>
<field name="model">survey.survey</field>
<field name="inherit_id" ref="survey.survey_tree"/>
<field name="inherit_id" ref="survey.survey_survey_view_tree" />
<field name="priority">28</field>
<field name="arch" type="xml">
<tree position="attributes">
<attribute name="decoration-muted">is_closed</attribute>
</tree>
<tree position="inside">
<field name="is_closed" invisible="1"/>
</tree>
<field name="stage_id" position="after">
<field name="date_deadline"/>
<field name="user_id" position="after">
<field name="deadline" />
<field name="auto_close" />
</field>
</field>
</record>
<record id="survey_survey_kanban" model="ir.ui.view">
<field name="name">survey_deadline_autoclose survey.survey kanban</field>
<record id="survey_survey_view_kanban" model="ir.ui.view">
<field name="name">survey_deadline_autoclose kanban</field>
<field name="model">survey.survey</field>
<field name="inherit_id" ref="survey.survey_kanban"/>
<field name="inherit_id" ref="survey.survey_survey_view_kanban" />
<field name="priority">28</field>
<field name="arch" type="xml">
<field name="title" position="after">
<field name="date_deadline"/>
<field name="color" position="after">
<field name="auto_close" />
</field>
<li id="survey_test" position="before">
<li t-if="record.date_deadline.raw_value" id="deadline" class="text-muted" t-att-title="record.auto_close.raw_value and 'Auto close on expiration' or 'Manual close'">
<t t-if="record.auto_close.raw_value">Expiration : <strong class="text-danger"><field name="date_deadline"/></strong></t>
<t t-else="">Expiration : <strong><field name="date_deadline"/></strong></t>
</li>
</li>
<xpath expr="//div[hasclass('o_survey_kanban_card_ungrouped', 'row', 'mx-0')]/div[1]" position="after">
<div t-if="!selection_mode and record.deadline.raw_value" class="col-lg-1 col-sm-4 col-6 py-0 my-2">
<span t-attf-class="fw-bold">
<field name="deadline" widget="date" />
</span>
<br />
<span class="text-muted"
t-attf-title="#{record.auto_close.raw_value ? 'Survey will be automatically closed once deadline passed' : ''}">
Deadline <i t-if="record.auto_close.raw_value" class="fa fa-cogs" /> <i
t-if="record.auto_close.raw_value" class="fa fa-long-arrow-right" /> <i
t-if="record.auto_close.raw_value" class="fa fa-archive" /></span>
</div>
</xpath>
</field>
</record>
<record id="survey_survey_search" model="ir.ui.view">
<field name="name">survey_deadline_autoclose survey.survey search</field>
<record id="survey_survey_view_search" model="ir.ui.view">
<field name="name">survey_deadline_autoclose search</field>
<field name="model">survey.survey</field>
<field name="inherit_id" ref="survey.survey_survey_view_search" />
<field name="priority">28</field>
<field name="arch" type="xml">
<search position="inside">
<group expand="0" string="Group By">
<filter string="Expiration month" name="group_date_deadline_month" context="{'group_by':'date_deadline:month'}"/>
</group>
</search>
<xpath expr="//filter[@name='group_by_responsible']" posititon="after">
<filter string="Deadline" name="group_by_deadline"
context="{'group_by':'deadline'}" />
</xpath>
</field>
</record>

0
survey_description/__init__.py

34
survey_description/i18n/fr.po

@ -1,34 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * survey_description
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-02-28 18:18+0000\n"
"PO-Revision-Date: 2023-02-28 18:18+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: survey_description
#: model_terms:ir.ui.view,arch_db:survey_description.survey_survey_form
msgid "Description"
msgstr ""
#. module: survey_description
#: model_terms:ir.ui.view,arch_db:survey_description.survey_survey_form
msgid "Thank you page"
msgstr "Page de remerciement"
#. module: survey_description
#: model_terms:ir.ui.view,arch_db:survey_description.survey_survey_form
msgid "This content will be displayed between the title of the survey and the \"Start\" button, on the answer homepage.<br/>\n"
" You can also add a custom content on each page of the survey through the \"Description\" field on each page."
msgstr "Ce contenu sera affiché entre le titre du sondage et le bouton \"Commencer\", sur la page d'accueil des réponses aux sondages.<br/>\n"
" Vous pouvez également ajouter du contenu spécifique sur chacune des pages du sondage via le champ \"Description\" de chaque page."

19
survey_description/views/survey_page.xml

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="survey_page_form" model="ir.ui.view">
<field name="name">survey_description survey.page form</field>
<field name="model">survey.page</field>
<field name="inherit_id" ref="survey.survey_page_form"/>
<field name="priority">20</field>
<field name="arch" type="xml">
<h1 position="after">
<label for="description" class="oe_edit_only"/>
</h1>
<field name="question_ids" position="before">
<field name="description" nolabel="1" colspan="2"/>
</field>
</field>
</record>
</odoo>

29
survey_description/views/survey_survey.xml

@ -1,29 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="survey_survey_form" model="ir.ui.view">
<field name="name">survey_description survey.survey form</field>
<field name="model">survey.survey</field>
<field name="inherit_id" ref="survey.survey_form"/>
<field name="priority">20</field>
<field name="arch" type="xml">
<xpath expr="//notebook/page[descendant::field[@name='page_ids']]" position="after">
<page name="description" string="Description">
<group>
<p colspan="2" class="text-muted oe_edit_only">
This content will be displayed between the title of the survey and the "Start" button, on the answer homepage.<br/>
You can also add a custom content on each page of the survey through the "Description" field on each page.
</p>
<field name="description" nolabel="1" colspan="2"/>
</group>
</page>
<page name="thank_you" string="Thank you page">
<group class="o_label_nowrap">
<field name="thank_you_message"/>
</group>
</page>
</xpath>
</field>
</record>
</odoo>

2
survey_input_attachment/__manifest__.py

@ -17,7 +17,7 @@
# "price": 0,
# "currency": "EUR",
"application": False,
"installable": True,
"installable": False,
"auto_install": False,
"pre_init_hook": "",
"post_init_hook": "",

71
survey_input_dates/i18n/fr.po

@ -1,71 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * survey_input_dates
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-02-28 20:38+0000\n"
"PO-Revision-Date: 2023-02-28 20:38+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: survey_input_dates
#: model:ir.model.fields,field_description:survey_input_dates.field_survey_user_input__date_done
#: model_terms:ir.ui.view,arch_db:survey_input_dates.survey_user_input_search
msgid "Date done"
msgstr "Réponse terminée le"
#. module: survey_input_dates
#: model:ir.model.fields,field_description:survey_input_dates.field_survey_user_input__duration
#: model:ir.model.fields,field_description:survey_input_dates.field_survey_user_input__duration_txt
msgid "Duration"
msgstr "Durée"
#. module: survey_input_dates
#: model:ir.model.fields,help:survey_input_dates.field_survey_user_input__duration
msgid "Duration in seconds"
msgstr "Durée en secondes"
#. module: survey_input_dates
#: code:addons/survey_input_dates/models/survey_user_input.py:39
#, python-format
msgid "Not done yet"
msgstr "Pas encore terminé"
#. module: survey_input_dates
#: code:addons/survey_input_dates/models/survey_user_input.py:36
#, python-format
msgid "Not started yet"
msgstr "Pas encore démarré"
#. module: survey_input_dates
#: model:ir.model.fields,field_description:survey_input_dates.field_survey_user_input__date_start
msgid "Start date"
msgstr "Début de réponse le"
#. module: survey_input_dates
#: model:ir.model,name:survey_input_dates.model_survey_survey
msgid "Survey"
msgstr "Sondage"
#. module: survey_input_dates
#: model:ir.model,name:survey_input_dates.model_survey_user_input
msgid "Survey User Input"
msgstr "Saisie utilisateur du sondage"
#. module: survey_input_dates
#: model:ir.model.fields,help:survey_input_dates.field_survey_user_input__date_start
msgid "This date is set when the user clicks on \"Start survey\" button for the first time."
msgstr "Cette date est renseignée lorsque le répondant clique sur le bouton \"Répondre\" pour la première fois."
#. module: survey_input_dates
#: model:ir.model.fields,help:survey_input_dates.field_survey_user_input__date_done
msgid "This date is set when the user input is set ton \"Done\" status."
msgstr "Cette date est renseignée lorsque la réponse passe au statut \"Terminé\"."

14
survey_input_dates/models/survey_survey.py

@ -1,14 +0,0 @@
from odoo import models, fields, api
class SurveySurvey(models.Model):
_inherit = 'survey.survey'
@api.model
def next_page(self, user_input, page_id, go_back=False):
res = super(SurveySurvey, self).next_page(user_input, page_id, go_back)
if not user_input.date_start and page_id == 0:
user_input.write({
'date_start': fields.Datetime.now(),
})
return res

55
survey_input_dates/models/survey_user_input.py

@ -1,55 +0,0 @@
from odoo import models, fields, api, _
class SurveyUserInput(models.Model):
_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.',
)
duration = fields.Integer(
string="Duration",
compute="_get_duration",
store=True,
help="Duration in seconds",
)
duration_txt = fields.Char(
string="Duration",
compute="_get_duration",
store=True,
)
@api.depends("date_start", "date_done")
def _get_duration(self):
for input in self:
start = input.date_start
done = input.date_done
if not start:
input.duration = 0
input.duration_txt = _("Not started yet")
elif not done:
input.duration = 0
input.duration_txt = _("Not done yet")
else:
input.duration = int((done - start).total_seconds())
input.duration_txt = self.env["ir.qweb.field.duration"].value_to_html(
(done - start).total_seconds(),
{"unit": "second", "round": "second"},
)
@api.multi
def write(self, vals):
if vals.get("state", False) == "done":
vals.update(
{
"date_done": fields.Datetime.now(),
}
)
return super(SurveyUserInput, self).write(vals)

65
survey_input_dates/views/survey_user_input.xml

@ -1,65 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="survey_user_input_form" model="ir.ui.view">
<field name="name">survey_input_dates survey.user_input form</field>
<field name="model">survey.user_input</field>
<field name="inherit_id" ref="survey.survey_user_input_form"/>
<field name="priority">26</field>
<field name="groups_id" eval="[(6,0,[ref('survey.group_survey_manager')])]"/>
<field name="arch" type="xml">
<field name="date_create" position="after">
<field name="date_start"/>
<field name="date_done"/>
<field name="duration" invisible="1"/>
<field name="duration_txt"/>
</field>
</field>
</record>
<record id="survey_user_input_tree" model="ir.ui.view">
<field name="name">survey_input_dates survey.user_input tree</field>
<field name="model">survey.user_input</field>
<field name="inherit_id" ref="survey.survey_user_input_tree"/>
<field name="priority">26</field>
<field name="groups_id" eval="[(6,0,[ref('survey.group_survey_manager')])]"/>
<field name="arch" type="xml">
<field name="date_create" position="after">
<field name="date_start"/>
<field name="date_done"/>
<field name="duration" invisible="1"/>
<field name="duration_txt"/>
</field>
</field>
</record>
<record id="view_survey_user_input_kanban" model="ir.ui.view">
<field name="name">survey_input_dates survey.user_input kanban</field>
<field name="model">survey.user_input</field>
<field name="inherit_id" ref="survey.view_survey_user_input_kanban"/>
<field name="priority">26</field>
<field name="groups_id" eval="[(6,0,[ref('survey.group_survey_manager')])]"/>
<field name="arch" type="xml">
<field name="date_create" position="after">
<field name="date_start"/>
<field name="date_done"/>
<field name="duration"/>
<field name="duration_txt"/>
</field>
</field>
</record>
<record id="survey_user_input_search" model="ir.ui.view">
<field name="name">survey_input_dates survey.user_input search</field>
<field name="model">survey.user_input</field>
<field name="inherit_id" ref="survey.survey_user_input_search"/>
<field name="priority">26</field>
<field name="groups_id" eval="[(6,0,[ref('survey.group_survey_manager')])]"/>
<field name="arch" type="xml">
<filter name="group_by_partner" position="after">
<filter string="Date done" name="by_date_done" domain="[]" context="{'group_by': 'date_done:week'}"/>
</filter>
</field>
</record>
</odoo>

0
survey_input_dates/__init__.py → survey_input_duration/__init__.py

12
survey_input_dates/__manifest__.py → survey_input_duration/__manifest__.py

@ -1,20 +1,21 @@
# -*- coding: utf-8 -*-
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
{
"name": "Survey input dates",
"name": "Survey input duration",
"version": "1.0.0",
"summary": """
Add start and done dates on survey answers
Compute duration on survey answers
""",
"description": """
This module adds start and done dates on surveys answers, and computes filling duration, readable by human.
This module computes surveys filling duration based on start and done dates and times.
""",
"author": "RemiFr82",
"contributors": "Sudokeys",
"contributors": "",
"website": "https://remifr82.me",
"maintainer": "RemiFr82",
"license": "LGPL-3",
"category": "Marketing",
# "price": 0,
# "price": 5,
# "currency": "EUR",
"application": False,
"installable": True,
@ -35,5 +36,4 @@
"js": [],
"test": [],
"demo": [],
"maintainer": "RemiFr82",
}

36
survey_input_duration/i18n/fr.po

@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * survey_input_duration
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0-20230613\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-12-28 16:49+0000\n"
"PO-Revision-Date: 2024-12-28 16:49+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: survey_input_duration
#: model_terms:ir.ui.view,arch_db:survey_input_duration.survey_user_input_view_search
msgid "Date done"
msgstr "Date de fin"
#. module: survey_input_duration
#: model:ir.model.fields,field_description:survey_input_duration.field_survey_user_input__duration
msgid "Duration"
msgstr "Durée"
#. module: survey_input_duration
#: model:ir.model.fields,help:survey_input_duration.field_survey_user_input__duration
msgid "Duration in hours"
msgstr "Durée en heures"
#. module: survey_input_duration
#: model:ir.model,name:survey_input_duration.model_survey_user_input
msgid "Survey User Input"
msgstr "Entrée utilisateur du sondage"

1
survey_input_dates/models/__init__.py → survey_input_duration/models/__init__.py

@ -1,2 +1 @@
from . import survey_survey
from . import survey_user_input

22
survey_input_duration/models/survey_user_input.py

@ -0,0 +1,22 @@
from odoo import models, fields, api, _
class SurveyUserInput(models.Model):
_inherit = "survey.user_input"
duration = fields.Integer(
string="Duration",
compute="_get_duration",
store=True,
help="Duration in hours",
)
@api.depends("start_datetime", "end_datetime")
def _get_duration(self):
for input in self:
start = input.start_datetime
done = input.end_datetime
if not (start and done):
input.duration = 0
else:
input.duration = int((done - start).total_seconds()) / 3600

58
survey_input_duration/views/survey_user_input.xml

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="survey_user_input_view_form" model="ir.ui.view">
<field name="name">survey_input_duration survey.user_input form</field>
<field name="model">survey.user_input</field>
<field name="inherit_id" ref="survey.survey_user_input_view_form" />
<field name="priority">26</field>
<field name="arch" type="xml">
<field name="deadline" position="after">
<field name="start_datetime" />
<field name="end_datetime" />
<field name="duration" widget="float_time" />
</field>
</field>
</record>
<record id="survey_user_input_view_tree" model="ir.ui.view">
<field name="name">survey_input_duration survey.user_input tree</field>
<field name="model">survey.user_input</field>
<field name="inherit_id" ref="survey.survey_user_input_view_tree" />
<field name="priority">26</field>
<field name="arch" type="xml">
<field name="deadline" position="after">
<field name="start_datetime" optional="hide" />
<field name="end_datetime" optional="hide" />
<field name="duration" widget="float_time" optional="show" />
</field>
</field>
</record>
<record id="survey_user_input_viuew_kanban" model="ir.ui.view">
<field name="name">survey_input_duration survey.user_input kanban</field>
<field name="model">survey.user_input</field>
<field name="inherit_id" ref="survey.survey_user_input_viuew_kanban" />
<field name="priority">26</field>
<field name="arch" type="xml">
<field name="create_date" position="after">
<field name="start_datetime" />
<field name="end_datetime" />
<field name="duration" />
</field>
</field>
</record>
<record id="survey_user_input_view_search" model="ir.ui.view">
<field name="name">survey_input_duration survey.user_input search</field>
<field name="model">survey.user_input</field>
<field name="inherit_id" ref="survey.survey_user_input_view_search" />
<field name="priority">26</field>
<field name="arch" type="xml">
<filter name="group_by_partner" position="after">
<filter string="Date done" name="by_end_datetime" domain="[]" context="{'group_by': 'end_datetime'}" />
</filter>
</field>
</record>
</odoo>

2
survey_input_odoo_debrand/__manifest__.py

@ -17,7 +17,7 @@
# "price": 0,
# "currency": "EUR",
"application": False,
"installable": True,
"installable": False,
"auto_install": False,
"pre_init_hook": "",
"post_init_hook": "",

2
survey_input_template_custom/__manifest__.py

@ -17,7 +17,7 @@
# "price": 0,
# "currency": "EUR",
"application": False,
"installable": True,
"installable": False,
"auto_install": False,
"pre_init_hook": "",
"post_init_hook": "",

2
survey_link_input_ratio/__manifest__.py

@ -17,7 +17,7 @@
# "price": 0,
# "currency": "EUR",
"application": False,
"installable": True,
"installable": False,
"auto_install": False,
"pre_init_hook": "",
"post_init_hook": "",

0
survey_page_duplicate/__init__.py

39
survey_page_duplicate/__manifest__.py

@ -1,39 +0,0 @@
# -*- coding: utf-8 -*-
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
{
"name": "Survey page duplicate",
"version": "1.0.0",
"summary": """
Quick duplicate surveys' pages
""",
"description": """
This module adds a \"Duplicate\" button in pages lines on survey form, only in edit mode.
""",
"author": "RemiFr82",
"contributors": "Sudokeys",
"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",
],
"css": [],
"images": [],
"js": [],
"test": [],
"demo": [],
"maintainer": "RemiFr82",
}

22
survey_page_duplicate/i18n/fr.po

@ -1,22 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * survey_page_duplicate
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-03-02 16:54+0000\n"
"PO-Revision-Date: 2023-03-02 16:54+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: survey_page_duplicate
#: model_terms:ir.ui.view,arch_db:survey_page_duplicate.survey_survey_form
msgid "Duplicate"
msgstr "Dupliquer"

16
survey_page_duplicate/views/survey_survey.xml

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="survey_survey_form" model="ir.ui.view">
<field name="name">survey_page_duplicate survey.survey form</field>
<field name="model">survey.survey</field>
<field name="inherit_id" ref="survey.survey_form"/>
<field name="priority">20</field>
<field name="arch" type="xml">
<xpath expr="//field[@name='page_ids']/tree" position="inside">
<button type="object" name="copy" string="Duplicate" icon="fa-copy" class="oe_edit_only"/>
</xpath>
</field>
</record>
</odoo>

14
survey_partner_input/i18n/fr.po

@ -29,23 +29,23 @@ msgstr "Réponses"
#. module: survey_partner_input
#: model_terms:ir.ui.view,arch_db:survey_partner_input.res_partner_form
msgid "Completed"
msgstr "Répondu"
msgstr "Répondus"
#. module: survey_partner_input
#: model:ir.model.fields,field_description:survey_partner_input.field_res_partner__tot_sent_comp_survey
#: model:ir.model.fields,field_description:survey_partner_input.field_res_users__tot_sent_comp_survey
#: model:ir.model.fields,field_description:survey_partner_input.field_res_partner__tot_sent_done_survey
#: model:ir.model.fields,field_description:survey_partner_input.field_res_users__tot_sent_done_survey
msgid "Completed sent survey count"
msgstr "Réponses privées terminées"
#. module: survey_partner_input
#: model:ir.model.fields,field_description:survey_partner_input.field_res_partner__sent_comp_ratio
#: model:ir.model.fields,field_description:survey_partner_input.field_res_users__sent_comp_ratio
#: model:ir.model.fields,field_description:survey_partner_input.field_res_partner__sent_done_ratio
#: model:ir.model.fields,field_description:survey_partner_input.field_res_users__sent_done_ratio
msgid "Completed sent survey ratio"
msgstr "Ratio de réponses privées terminées"
#. module: survey_partner_input
#: model:ir.model.fields,field_description:survey_partner_input.field_res_partner__tot_comp_survey
#: model:ir.model.fields,field_description:survey_partner_input.field_res_users__tot_comp_survey
#: model:ir.model.fields,field_description:survey_partner_input.field_res_partner__tot_done_survey
#: model:ir.model.fields,field_description:survey_partner_input.field_res_users__tot_done_survey
msgid "Completed survey count"
msgstr "Réponses terminées"

43
survey_partner_input/models/res_partner.py

@ -6,29 +6,28 @@ class ResPartner(models.Model):
_inherit = "res.partner"
tot_sent_survey = fields.Integer("Sent survey count", compute="_count_survey_input")
tot_comp_survey = fields.Integer(
tot_done_survey = fields.Integer(
"Completed survey count", compute="_count_survey_input"
)
tot_sent_comp_survey = fields.Integer(
tot_sent_done_survey = fields.Integer(
"Completed sent survey count", compute="_count_survey_input"
)
sent_comp_ratio = fields.Integer(
string="Completed sent survey ratio", compute="_get_sent_comp_ratio"
sent_done_ratio = fields.Integer(
string="Completed sent survey ratio", compute="_get_sent_done_ratio"
)
# COMPUTES
@api.multi
def _count_survey_input(self):
UserInput = self.env["survey.user_input"]
partners_survey = UserInput
in_onchange = self.env.in_onchange
in_onchange = self.env.context.get("in_onchange", False)
origin = in_onchange and self._origin or False
if in_onchange:
domain = [
("partner_id", "=", self._origin.id),
"|",
("type", "=", "link"),
("invite_token", "not in", [False, None]),
("state", "=", "dones"),
]
if self.email:
@ -41,7 +40,7 @@ class ResPartner(models.Model):
("partner_id", "in", self.ids),
("email", "in", self.filtered("email").mapped("email")),
"|",
("type", "=", "link"),
("invite_token", "not in", [False, None]),
("state", "=", "done"),
]
)
@ -60,25 +59,24 @@ class ResPartner(models.Model):
or partner.email
and sui.email == partner.email
)
and sui.type == "link"
and sui.invite_token
)
partner.tot_sent_survey = len(link)
partner.tot_comp_survey = len(done)
partner.tot_sent_comp_survey = len(link & done)
partner.tot_done_survey = len(done)
partner.tot_sent_done_survey = len(link & done)
@api.depends("tot_sent_comp_survey", "tot_sent_survey")
def _get_sent_comp_ratio(self):
@api.depends("tot_sent_done_survey", "tot_sent_survey")
def _get_sent_done_ratio(self):
for survey in self:
if survey.tot_sent_survey == 0:
survey.sent_comp_ratio = 0
survey.sent_done_ratio = 0
else:
survey.sent_comp_ratio = int(
round(100 * survey.tot_sent_comp_survey / survey.tot_sent_survey, 0)
survey.sent_done_ratio = int(
round(100 * survey.tot_sent_done_survey / survey.tot_sent_survey, 0)
)
# ACTIONS
@api.multi
def action_survey_user_input(self):
self.ensure_one()
action = self.env.ref("survey.action_survey_user_input").read()[0]
@ -102,9 +100,14 @@ class ResPartner(models.Model):
domain = ["|", ("partner_id", "=", self.id), ("email", "ilike", self.email)]
if link_only:
if len(domain) > 1:
domain = AND([[("type", "=", "link")], normalize_domain(domain)])
domain = AND(
[
[("invite_token", "not in", [False, None])],
normalize_domain(domain),
]
)
else:
domain = [("type", "=", "link")]
domain = [("invite_token", "not in", [False, None])]
action["domain"] = domain
# return updated action
return action
@ -115,4 +118,4 @@ class ResPartner(models.Model):
def onchange_email(self):
self.ensure_one()
if isinstance(self._origin.id, int):
self._count_survey_input()
self.with_context(in_onchange=True)._count_survey_input()

10
survey_partner_input/views/res_partner.xml

@ -12,18 +12,18 @@
context="{'link_only':1, 'search_default_by_state':1}"
attrs="{'invisible':[('tot_sent_survey','=',0)]}" class="oe_stat_button"
groups="survey.group_survey_user">
<field string="Completed" name="sent_comp_ratio" widget="percentpie"/>
<field string="Completed" name="sent_done_ratio" widget="percentpie" />
</button>
<button type="object" name="action_survey_user_input" class="oe_stat_button" icon="fa-pencil-square-o"
context="{'search_default_completed':1, 'search_default_group_by_survey':1}"
attrs="{'invisible':[('tot_sent_survey','=',0),('tot_comp_survey','=',0)]}"
context="{'search_default_doneleted':1, 'search_default_group_by_survey':1}"
attrs="{'invisible':[('tot_sent_survey','=',0),('tot_done_survey','=',0)]}"
groups="survey.group_survey_user">
<field string="Answers" name="tot_comp_survey" widget="statinfo"/>
<field string="Answers" name="tot_done_survey" widget="statinfo" />
</button>
</xpath>
<xpath expr="//div[hasclass('oe_title')]" position="after">
<field name="tot_sent_survey" invisible="1" groups="survey.group_survey_user" />
<field name="tot_sent_comp_survey" invisible="1" groups="survey.group_survey_user"/>
<field name="tot_sent_done_survey" invisible="1" groups="survey.group_survey_user" />
</xpath>
</field>
</record>

4
survey_partner_input/views/survey_user_input.xml

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="survey_user_input_search" model="ir.ui.view">
<record id="survey_user_input_view_search" model="ir.ui.view">
<field name="name">survey_partner_input survey.user_input search</field>
<field name="model">survey.user_input</field>
<field name="inherit_id" ref="survey.survey_user_input_search"/>
<field name="inherit_id" ref="survey.survey_user_input_view_search" />
<field name="priority">26</field>
<field name="arch" type="xml">
<filter name="group_by_partner" position="after">

1
survey_pass_fail_messages/__init__.py

@ -0,0 +1 @@
from . import models

12
survey_description/__manifest__.py → survey_pass_fail_messages/__manifest__.py

@ -1,16 +1,17 @@
# -*- coding: utf-8 -*-
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
{
"name": "Survey description",
"name": "Survey score message",
"version": "1.0.0",
"summary": """
Edit description fields on surveys and pages
Add score specific message to survey done page
""",
"description": """
This module displays standard HTML fields \"Description\" and \"Thank you message\" on survey and survey pages.
This module adds 2 text fiels on surveys that are displayed according to the succes (or fail) regarding the score.
""",
"author": "RemiFr82",
"contributors": "Sudokeys",
"contributors": "",
"maintainer": "RemiFr82",
"website": "https://remifr82.me",
"license": "LGPL-3",
"category": "Marketing",
@ -28,13 +29,12 @@
"survey",
],
"data": [
"views/survey_page.xml",
"views/survey_survey.xml",
"views/survey_templates.xml",
],
"css": [],
"images": [],
"js": [],
"test": [],
"demo": [],
"maintainer": "RemiFr82",
}

77
survey_pass_fail_messages/i18n/fr.po

@ -0,0 +1,77 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * survey_pass_fail_messages
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0-20230613\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-12-22 14:49+0000\n"
"PO-Revision-Date: 2024-12-22 14:49+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: survey_pass_fail_messages
#: model_terms:ir.ui.view,arch_db:survey_pass_fail_messages.survey_survey_form
msgid ""
"Certification failed end message (following the standard \"Unfortunately, "
"you have failed the test.\" message)"
msgstr ""
"Message de fin en cas d'échec (inséré après le message \"Malheureusement, "
"vous avez raté le test.\")"
#. module: survey_pass_fail_messages
#: model_terms:ir.ui.view,arch_db:survey_pass_fail_messages.survey_survey_form
msgid ""
"Certification passed end message (following the standard \"Congratulations, "
"you have passed the test!\" message)"
msgstr ""
"Message de fin en cas de réussite (inséré après le message \"Félicitations, "
"vous avez réussi le test !\")"
#. module: survey_pass_fail_messages
#: model:ir.model.fields,field_description:survey_pass_fail_messages.field_survey_survey__description_done_fail
msgid "Failed end message"
msgstr "Message d'échec"
#. module: survey_pass_fail_messages
#: model:ir.model.fields,field_description:survey_pass_fail_messages.field_survey_survey__description_done_pass
msgid "Passed end message"
msgstr "Message de réussite"
#. module: survey_pass_fail_messages
#: model:ir.model,name:survey_pass_fail_messages.model_survey_survey
msgid "Survey"
msgstr "Sondage"
#. module: survey_pass_fail_messages
#: model:ir.model.fields,help:survey_pass_fail_messages.field_survey_survey__description_done_fail
msgid ""
"This message will be displayed when survey is completed and the user failed "
"the test."
msgstr ""
"Ce message sera affiché quand le sondage est terminé si l'utilisateur rate "
"le test."
#. module: survey_pass_fail_messages
#: model:ir.model.fields,help:survey_pass_fail_messages.field_survey_survey__description_done_pass
msgid ""
"This message will be displayed when survey is completed and the user passed "
"the test."
msgstr ""
"Ce message sera affiché quand le sondage est terminé si l'utilisateur "
"réussit le test."
#. module: survey_pass_fail_messages
#: model_terms:ir.ui.view,arch_db:survey_pass_fail_messages.survey_survey_form
msgid "e.g. \"Passing the test gives you the possibility to...\""
msgstr "ex. \"Réussir ce test vous permet de...\""
#. module: survey_pass_fail_messages
#: model_terms:ir.ui.view,arch_db:survey_pass_fail_messages.survey_survey_form
msgid "e.g. \"You can retry this test after...\""
msgstr "ex. \"Vous pourrez retenter ce test après...\""

1
survey_pass_fail_messages/models/__init__.py

@ -0,0 +1 @@
from . import survey_survey

17
survey_pass_fail_messages/models/survey_survey.py

@ -0,0 +1,17 @@
from odoo import models, fields, api, _
from odoo.exceptions import UserError
class SurveySurvey(models.Model):
_inherit = "survey.survey"
description_done_pass = fields.Html(
string="Passed end message",
translate=True,
help="This message will be displayed when survey is completed and the user passed the test.",
)
description_done_fail = fields.Html(
string="Failed end message",
translate=True,
help="This message will be displayed when survey is completed and the user failed the test.",
)

25
survey_pass_fail_messages/views/survey_survey.xml

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- survey views and actions -->
<record id="survey_survey_form" model="ir.ui.view">
<field name="name">survey_template survey.survey form</field>
<field name="model">survey.survey</field>
<field name="inherit_id" ref="survey.survey_survey_view_form" />
<field name="priority">22</field>
<field name="arch" type="xml">
<field name="description_done" position="after">
<label for="description_done_pass" attrs="{'invisible':[('scoring_type','=','no_scoring')]}"
string="Certification passed end message (following the standard &quot;Congratulations, you have passed the test!&quot; message)" />
<field name="description_done_pass" attrs="{'invisible':[('scoring_type','=','no_scoring')]}"
placeholder="e.g. &quot;Passing the test gives you the possibility to...&quot;" />
<label for="description_done_fail" attrs="{'invisible':[('scoring_type','=','no_scoring')]}"
string="Certification failed end message (following the standard &quot;Unfortunately, you have failed the test.&quot; message)" />
<field name="description_done_fail" attrs="{'invisible':[('scoring_type','=','no_scoring')]}"
placeholder="e.g. &quot;You can retry this test after...&quot;" />
</field>
</field>
</record>
</odoo>

15
survey_pass_fail_messages/views/survey_templates.xml

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="survey_fill_form_done" name="Survey: finished score" inherit_id="survey.survey_fill_form_done">
<xpath expr="//t[@t-if='answer.scoring_success']/div[1]" position="after">
<div t-field="survey.description_done_pass" class="oe_no_empty" />
</xpath>
<xpath expr="//t[@t-else='']/div[1]" position="after">
<div t-field="survey.description_done_fail" class="oe_no_empty" />
</xpath>
</template>
</data>
</odoo>

2
survey_question_duplicate/__manifest__.py

@ -17,7 +17,7 @@
# "price": 0,
# "currency": "EUR",
"application": False,
"installable": True,
"installable": False,
"auto_install": False,
"pre_init_hook": "",
"post_init_hook": "",

2
survey_select_input/__manifest__.py

@ -17,7 +17,7 @@
# "price": 0,
# "currency": "EUR",
"application": False,
"installable": True,
"installable": False,
"auto_install": False,
"pre_init_hook": "",
"post_init_hook": "",

2
survey_template/__manifest__.py

@ -17,7 +17,7 @@
# "price": 0,
# "currency": "EUR",
"application": False,
"installable": True,
"installable": False,
"auto_install": False,
"pre_init_hook": "",
"post_init_hook": "",

|||||||
100:0
Loading…
Cancel
Save