Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
568 Tampilan

Hi Team,

I need to extend answer type under questions (appointments) to include HTML and others. Currently only see single line text, multi line text, check box, drop down.

Is there away to easily extend this list?

Thanks

Avatar
Buang
Jawaban Terbai

Hi,


1. Inherit the appointment.question model


Create a custom module, and inherit the model to add your custom types:


from odoo import models, fields


class AppointmentQuestion(models.Model):

    _inherit = 'appointment.question'


    answer_type = fields.Selection(

        selection_add=[

            ('html', 'HTML'),

            # You can add more custom types

        ],

        ondelete={'html': 'set default'}  # Handle deletion behavior

    )


Hope it helps

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
0
Feb 25
1033
0
Feb 25
885
0
Mar 25
750
0
Nov 24
827
1
Jun 25
409