Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
577 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
úno 25
1042
0
úno 25
890
0
bře 25
757
0
lis 24
836
1
čvn 25
423