Skip to Content
Menú
This question has been flagged
1 Respondre
571 Vistes

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
Descartar
Best Answer

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
Descartar
Related Posts Respostes Vistes Activitat
0
de febr. 25
1037
0
de febr. 25
885
0
de març 25
751
0
de nov. 24
832
1
de juny 25
415