Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
594 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
feb 25
1075
0
feb 25
943
0
mar 25
835
0
nov 24
861
1
giu 25
508