Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
607 Weergaven

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
Annuleer
Beste antwoord

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
0
feb. 25
1093
0
feb. 25
952
0
mrt. 25
842
0
nov. 24
863
1
jun. 25
517