Some checks failed
pre-commit / pre-commit (pull_request) Failing after 1m39s
18 lines
501 B
Python
18 lines
501 B
Python
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
|
|
|
from odoo import fields, models
|
|
|
|
|
|
class SurveyUserInputLine(models.Model):
|
|
_inherit = "survey.user_input.line"
|
|
|
|
answer_type = fields.Selection(
|
|
selection_add=[("file", "File")]
|
|
)
|
|
|
|
def _compute_display_name(self):
|
|
super()._compute_display_name()
|
|
for line in self:
|
|
if line.answer_type == "file" and line.value_file_fname:
|
|
line.display_name = line.value_file_fname
|