Browse Source

[I18N] survey_deadline_autoclose internationalization

12.0
Rémi FRANÇOIS 5 years ago
parent
commit
e46e8a6bd8
  1. 4
      survey_deadline_autoclose/__manifest__.py
  2. 4
      survey_deadline_autoclose/data/ir_cron.xml
  3. 10
      survey_deadline_autoclose/data/mail_message_subtype.xml
  4. 75
      survey_deadline_autoclose/i18n/fr.po
  5. 75
      survey_deadline_autoclose/i18n/survey_deadline_autoclose.pot
  6. 8
      survey_deadline_autoclose/models/survey_survey.py
  7. 8
      survey_deadline_autoclose/views/survey_survey.xml

4
survey_deadline_autoclose/__manifest__.py

@ -1,8 +1,8 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{ {
'name': 'Survey deadline auto-close',
'version': '0.1.0',
'name': 'Auto-close survey on deadline',
'version': '1.0.0',
'summary': """ 'summary': """
The module adds a deadline date on surveys and a checkbox to automatically close them with a planned action. The module adds a deadline date on surveys and a checkbox to automatically close them with a planned action.
""", """,

4
survey_deadline_autoclose/data/ir_cron.xml

@ -3,8 +3,8 @@
<data noupdate="1"> <data noupdate="1">
<!-- <data> --> <!-- <data> -->
<record model="ir.cron" id="set_customer_inactive">
<field name="name">Clôture des sondages arrivés à échéance</field>
<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="model_id" ref="survey.model_survey_survey"/>
<field name="state">code</field> <field name="state">code</field>
<field name="code">model.action_close_survey()</field> <field name="code">model.action_close_survey()</field>

10
survey_deadline_autoclose/data/mail_message_subtype.xml

@ -2,20 +2,20 @@
<odoo> <odoo>
<data noupdate="1"> <data noupdate="1">
<record id="mail_message_subtype_survey_deadline" model="mail.message.subtype">
<field name="name">Sondage Échu</field>
<record id="mail_message_subtype_survey_expired" model="mail.message.subtype">
<field name="name">Expired survey</field>
<field name="res_model">survey.survey</field> <field name="res_model">survey.survey</field>
<field name="default" eval="True"/> <field name="default" eval="True"/>
<field name="hidden" eval="False"/> <field name="hidden" eval="False"/>
<field name="description">Ce sondage est arrivé à échéance.</field>
<field name="description">This survey has expired.</field>
</record> </record>
<record id="mail_message_subtype_survey_closed" model="mail.message.subtype"> <record id="mail_message_subtype_survey_closed" model="mail.message.subtype">
<field name="name">Sondage Clos</field>
<field name="name">Closed survey</field>
<field name="res_model">survey.survey</field> <field name="res_model">survey.survey</field>
<field name="default" eval="True"/> <field name="default" eval="True"/>
<field name="hidden" eval="False"/> <field name="hidden" eval="False"/>
<field name="description">Ce sondage a été clôturé.</field>
<field name="description">This survey was closed.</field>
</record> </record>
</data> </data>

75
survey_deadline_autoclose/i18n/fr.po

@ -0,0 +1,75 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * survey_deadline_autoclose
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-03-23 10:23+0000\n"
"PO-Revision-Date: 2020-03-23 10:23+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:ir.model.fields,field_description:survey_deadline_autoclose.field_survey_survey__auto_close
msgid "Auto close at deadline"
msgstr "Clôture automatique à l’échéance"
#. 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"
#. module: survey_deadline_autoclose
#: model_terms:ir.ui.view,arch_db:survey_deadline_autoclose.survey_survey_form
msgid "Close survey"
msgstr "Clore ce sondage"
#. 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
msgid "Deadline"
msgstr "Date limite"
#. 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:mail.message.subtype,name:survey_deadline_autoclose.mail_message_subtype_survey_expired
msgid "Expired survey"
msgstr "Sondage expiré"
#. module: survey_deadline_autoclose
#: code:addons/survey_deadline_autoclose/models/survey_survey.py:38
#, python-format
msgid "No \"closed\" status found, the requested operation is impossible."
msgstr "Aucun statut qualifié de \"fermé\" n'a été trouvé, l'opération demandée est impossible."
#. module: survey_deadline_autoclose
#: model:ir.model,name:survey_deadline_autoclose.model_survey_survey
msgid "Survey"
msgstr "Sondage"
#. module: survey_deadline_autoclose
#: model:mail.message.subtype,description:survey_deadline_autoclose.mail_message_subtype_survey_expired
msgid "This survey has expired."
msgstr "Ce sondage a été clôturé."
#. module: survey_deadline_autoclose
#: model:mail.message.subtype,description:survey_deadline_autoclose.mail_message_subtype_survey_closed
msgid "This survey was closed."
msgstr "Ce sondage est arrivé à échéance."

75
survey_deadline_autoclose/i18n/survey_deadline_autoclose.pot

@ -0,0 +1,75 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * survey_deadline_autoclose
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-03-23 10:25+0000\n"
"PO-Revision-Date: 2020-03-23 10:25+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:ir.model.fields,field_description:survey_deadline_autoclose.field_survey_survey__auto_close
msgid "Auto close at deadline"
msgstr ""
#. 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 ""
#. module: survey_deadline_autoclose
#: model_terms:ir.ui.view,arch_db:survey_deadline_autoclose.survey_survey_form
msgid "Close survey"
msgstr ""
#. module: survey_deadline_autoclose
#: model:mail.message.subtype,name:survey_deadline_autoclose.mail_message_subtype_survey_closed
msgid "Closed survey"
msgstr ""
#. module: survey_deadline_autoclose
#: model:ir.model.fields,field_description:survey_deadline_autoclose.field_survey_survey__date_deadline
msgid "Deadline"
msgstr ""
#. module: survey_deadline_autoclose
#: model_terms:ir.ui.view,arch_db:survey_deadline_autoclose.survey_survey_kanban
msgid "Expiration :"
msgstr ""
#. module: survey_deadline_autoclose
#: model:mail.message.subtype,name:survey_deadline_autoclose.mail_message_subtype_survey_expired
msgid "Expired survey"
msgstr ""
#. module: survey_deadline_autoclose
#: code:addons/survey_deadline_autoclose/models/survey_survey.py:38
#, python-format
msgid "No \"closed\" status found, the requested operation is impossible."
msgstr ""
#. module: survey_deadline_autoclose
#: model:ir.model,name:survey_deadline_autoclose.model_survey_survey
msgid "Survey"
msgstr ""
#. module: survey_deadline_autoclose
#: model:mail.message.subtype,description:survey_deadline_autoclose.mail_message_subtype_survey_expired
msgid "This survey has expired."
msgstr ""
#. module: survey_deadline_autoclose
#: model:mail.message.subtype,description:survey_deadline_autoclose.mail_message_subtype_survey_closed
msgid "This survey was closed."
msgstr ""

8
survey_deadline_autoclose/models/survey_survey.py

@ -1,4 +1,4 @@
from odoo import models, fields, api
from odoo import models, fields, api, _
from odoo.exceptions import UserError from odoo.exceptions import UserError
@ -17,8 +17,8 @@ class SurveySurvey(models.Model):
for survey in deadline - to_close: for survey in deadline - to_close:
survey.message_post(subtype='survey_deadline_autoclose.mail_message_subtype_survey_deadline') survey.message_post(subtype='survey_deadline_autoclose.mail_message_subtype_survey_deadline')
date_deadline = fields.Date(string="Date d'échéance", help="Passé cette date, il ne sera plus possible de répondre au sondage.", copy=False)
auto_close = fields.Boolean(string="Clôture automatique à l'échéance", default=False)
date_deadline = fields.Date(string="Deadline", copy=False)
auto_close = fields.Boolean(string="Auto close at deadline", default=False)
# ACTIONS # ACTIONS
@ -35,7 +35,7 @@ class SurveySurvey(models.Model):
def action_close_survey(self): def action_close_survey(self):
stage = self.env['survey.stage'].search([('closed', '=', True)], limit=1) stage = self.env['survey.stage'].search([('closed', '=', True)], limit=1)
if not stage: if not stage:
raise UserError("Aucun statut qualifié de \"fermé\" n'a été trouvé, l'opération demandée est impossible.")
raise UserError(_("No \"closed\" status found, the requested operation is impossible."))
self.write({ self.write({
'stage_id': stage.id 'stage_id': stage.id
}) })

8
survey_deadline_autoclose/views/survey_survey.xml

@ -8,7 +8,7 @@
<field name="priority">25</field> <field name="priority">25</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<field name="stage_id" position="before"> <field name="stage_id" position="before">
<button name="action_close_survey" string="Clore le sondage" type="object" attrs="{'invisible': [('is_closed', '=', True)]}"/>
<button name="action_close_survey" string="Close survey" type="object" attrs="{'invisible': [('is_closed', '=', True)]}"/>
</field> </field>
<xpath expr="//group[hasclass('o_label_nowrap')]/.." position="inside"> <xpath expr="//group[hasclass('o_label_nowrap')]/.." position="inside">
<group name="options"> <group name="options">
@ -56,9 +56,9 @@
<field name="auto_close"/> <field name="auto_close"/>
</field> </field>
<li id="survey_test" position="before"> <li id="survey_test" position="before">
<li t-if="record." id="deadline" class="text-muted" t-att-title="record.auto_close.raw_value and 'Clôture automatique à l'échéance or 'Clôture manuelle'">
<t t-if="record.auto_close.raw_value">Échéance : <strong class="text-danger"><field name="date_deadline"/></strong></t>
<t t-else="">Échéance : <strong><field name="date_deadline"/></strong></t>
<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>
</li> </li>
</field> </field>

Loading…
Cancel
Save