[NEW] survey_notify
This commit is contained in:
1
survey_notify/__init__.py
Normal file
1
survey_notify/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from . import models
|
23
survey_notify/__manifest__.py
Normal file
23
survey_notify/__manifest__.py
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# Copyright 2016-2020 Akretion France (<https://www.akretion.com>)
|
||||||
|
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||||
|
|
||||||
|
{
|
||||||
|
"name": "Survey notify",
|
||||||
|
'summary': 'Add chatter message in survey after survey response',
|
||||||
|
'description': """
|
||||||
|
Add chatter message in survey after survey response
|
||||||
|
----------------------------------------------------
|
||||||
|
*
|
||||||
|
""",
|
||||||
|
"version": "16.0.1.0.0",
|
||||||
|
"license": "AGPL-3",
|
||||||
|
"author": "Elabore",
|
||||||
|
"website": "https://www.elabore.coop",
|
||||||
|
"category": "",
|
||||||
|
"depends": ["survey"],
|
||||||
|
"data": [
|
||||||
|
|
||||||
|
],
|
||||||
|
"installable": True,
|
||||||
|
}
|
49
survey_notify/i18n/fr.po
Normal file
49
survey_notify/i18n/fr.po
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * survey_notify
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server 16.0\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2024-04-15 09:48+0000\n"
|
||||||
|
"PO-Revision-Date: 2024-04-15 09:48+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_notify
|
||||||
|
#. odoo-python
|
||||||
|
#: code:addons/survey_notify/models/survey_user_input.py:0
|
||||||
|
#, python-format
|
||||||
|
msgid "New <b>%(response)s</b> "
|
||||||
|
msgstr "Nouvelle <b>%(response)s</b> "
|
||||||
|
|
||||||
|
#. module: survey_notify
|
||||||
|
#. odoo-python
|
||||||
|
#: code:addons/survey_notify/models/survey_user_input.py:0
|
||||||
|
#, python-format
|
||||||
|
msgid "response"
|
||||||
|
msgstr "réponse"
|
||||||
|
|
||||||
|
#. module: survey_notify
|
||||||
|
#: model:ir.model,name:survey_notify.model_survey_user_input
|
||||||
|
msgid "Survey User Input for custom matrix"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: survey_notify
|
||||||
|
#. odoo-python
|
||||||
|
#: code:addons/survey_notify/models/survey_user_input.py:0
|
||||||
|
#, python-format
|
||||||
|
msgid "for survey <b>%(survey)s</b> "
|
||||||
|
msgstr "pour le questionnaire <b>%(survey)s</b> "
|
||||||
|
|
||||||
|
#. module: survey_notify
|
||||||
|
#. odoo-python
|
||||||
|
#: code:addons/survey_notify/models/survey_user_input.py:0
|
||||||
|
#, python-format
|
||||||
|
msgid "of <b>%(partner)s</b> "
|
||||||
|
msgstr "de <b>%(partner)s</b> "
|
1
survey_notify/models/__init__.py
Normal file
1
survey_notify/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from . import survey_user_input
|
25
survey_notify/models/survey_user_input.py
Normal file
25
survey_notify/models/survey_user_input.py
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
|
||||||
|
import logging
|
||||||
|
import textwrap
|
||||||
|
import uuid
|
||||||
|
|
||||||
|
from dateutil.relativedelta import relativedelta
|
||||||
|
|
||||||
|
from odoo import api, fields, models, _
|
||||||
|
from odoo.exceptions import ValidationError
|
||||||
|
from odoo.tools import float_is_zero
|
||||||
|
|
||||||
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
class SurveyUserInput(models.Model):
|
||||||
|
_inherit = 'survey.user_input'
|
||||||
|
|
||||||
|
def _mark_done(self):
|
||||||
|
res = super(SurveyUserInput, self)._mark_done()
|
||||||
|
msg = _('New <b>%(response)s</b> ', response=self._get_html_link(_("response")))
|
||||||
|
if self.partner_id:
|
||||||
|
msg += _('of <b>%(partner)s</b> ', partner=self.partner_id._get_html_link(self.partner_id.name))
|
||||||
|
msg += _('for survey <b>%(survey)s</b> ', survey=self.survey_id._get_html_link(self.survey_id.title))
|
||||||
|
self.survey_id.message_post(body=msg)
|
||||||
|
return res
|
Reference in New Issue
Block a user