Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
603 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhấ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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 2 25
1090
0
thg 2 25
949
0
thg 3 25
838
0
thg 11 24
863
1
thg 6 25
514