İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
566 Görünümler

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
Vazgeç
En İyi Yanıt

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
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
0
Şub 25
1031
0
Şub 25
882
0
Mar 25
749
0
Kas 24
823
1
Haz 25
406