コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
602 ビュー

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

アバター
破棄
最善の回答

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

アバター
破棄
関連投稿 返信 ビュー 活動
0
2月 25
1088
0
2月 25
948
0
3月 25
836
0
11月 24
863
1
6月 25
512