Skip to content
Extraits de code Groupes Projets
Valider 42ef9f8a rédigé par Benjamin - Le Filament's avatar Benjamin - Le Filament
Parcourir les fichiers

[REF] move cgscop_survey into training_survey

parent 2106dc8c
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * survey
#
# Translators:
# Rémi CAZENAVE, 2022
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-04-26 13:31+0000\n"
"PO-Revision-Date: 2022-09-22 05:55+0000\n"
"Language-Team: French \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: fr\n"
"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n"
#. module: survey
#: model_terms:ir.ui.view,arch_db:survey.survey_fill_form_start
msgid "Start Survey"
msgstr "Démarrer le questionnaire"
...@@ -56,6 +56,11 @@ class Survey(models.Model): ...@@ -56,6 +56,11 @@ class Survey(models.Model):
default=False, default=False,
help="Afficher un bouton pour pouvoir refaire le sondage une fois terminé", help="Afficher un bouton pour pouvoir refaire le sondage une fois terminé",
) )
company_id = fields.Many2one(
comodel_name="res.company",
string="Société",
default=lambda self: self.env.company,
)
# ------------------------------------------------------ # ------------------------------------------------------
# Constrains # Constrains
......
...@@ -7,6 +7,11 @@ from odoo import Command, fields, models ...@@ -7,6 +7,11 @@ from odoo import Command, fields, models
class SurveyUserInput(models.Model): class SurveyUserInput(models.Model):
_inherit = "survey.user_input" _inherit = "survey.user_input"
# Inherit parent
state = fields.Selection(tracking=1)
# New fields
answer_url = fields.Char(string="URL de la réponse", compute="_compute_answer_url")
comment = fields.Text("Notes")
firstname = fields.Char("Prénom") firstname = fields.Char("Prénom")
company = fields.Char("Structure") company = fields.Char("Structure")
is_duplicate_answer = fields.Boolean(default=False) is_duplicate_answer = fields.Boolean(default=False)
...@@ -116,6 +121,11 @@ class SurveyUserInput(models.Model): ...@@ -116,6 +121,11 @@ class SurveyUserInput(models.Model):
# ------------------------------------------------------ # ------------------------------------------------------
# Compute # Compute
# ------------------------------------------------------ # ------------------------------------------------------
def _compute_answer_url(self):
for answer in self:
answer.answer_url = url_join(
answer.survey_id.get_base_url(), answer.get_start_url()
)
# ------------------------------------------------------ # ------------------------------------------------------
# Actions # Actions
......
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="0">
<record id="survey_server_rule" model="ir.rule">
<field name="name">survey multi-company</field>
<field name="model_id" ref="survey.model_survey_survey" />
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="False"/>
<field name="perm_create" eval="False"/>
<field name="perm_unlink" eval="False"/>
<field
name="domain_force"
>[('company_id', 'in', company_ids + [False])]</field>
</record>
</odoo>
...@@ -143,13 +143,13 @@ ...@@ -143,13 +143,13 @@
<!-- Actions --> <!-- Actions -->
<!-- Inherit parent action for domain --> <!-- Inherit parent action for domain -->
<record model="ir.actions.act_window" id="survey.action_survey_form"> <record model="ir.actions.act_window" id="survey.action_survey_form">
<field name="domain">[("survey_type", "=", False)]</field> <field name="domain">[("survey_type", "=", False), ("company_id", "in", allowed_company_ids)]</field>
</record> </record>
<!-- New Actions --> <!-- New Actions -->
<record model="ir.actions.act_window" id="action_training_survey"> <record model="ir.actions.act_window" id="action_training_survey">
<field name="name">Questionnaires formation</field> <field name="name">Questionnaires formation</field>
<field name="res_model">survey.survey</field> <field name="res_model">survey.survey</field>
<field name="domain">[("survey_type", "=", "training")]</field> <field name="domain">[("survey_type", "=", "training"), ("company_id", "in", allowed_company_ids)]</field>
<field name="view_mode">kanban,tree,form,activity</field> <field name="view_mode">kanban,tree,form,activity</field>
<field name="context">{"default_survey_type": "training"}</field> <field name="context">{"default_survey_type": "training"}</field>
<field name="search_view_id" ref="training_survey_search" /> <field name="search_view_id" ref="training_survey_search" />
......
...@@ -8,6 +8,12 @@ ...@@ -8,6 +8,12 @@
<field name="priority">60</field> <field name="priority">60</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//sheet/group/group" position="inside"> <xpath expr="//sheet/group/group" position="inside">
<field name="comment" />
<field
name="answer_url"
attrs="{'invisible': [('state', '=', 'done')]}"
widget="CopyClipboardChar"
/>
<field name="is_resent" invisible="1" /> <field name="is_resent" invisible="1" />
<div colspan="2"> <div colspan="2">
<button <button
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter