Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
2500 มุมมอง

In the Odoo 17 events module, I want to add a date field under the name, so that later on the events website, when the registration form appears, the calendar appears to be able to choose a date, is it possible?

How do we inherit that specific form to modify it?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,


1. Inherit the event question and add the custom_date field.


class EventQuestion(models.Model):
    _inherit = 'event.question'


  custom_date = fields.Date(string='Date')


2. Add the following to the views directory,


<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="event_question_view_form" model="ir.ui.view">
<field name="name">event.question.view.form,inherited</field>
<field name="model">event.question</field>
<field name="inherit_id" ref="website_event.event_question_view_form"/>
        <field name="arch" type="xml">
            <field name="is_mandatory_answer" position="before">
                <field name="custom_date"/>
            </field>
        </field>
    </record>
</odoo>


Hope it helps


อวตาร
ละทิ้ง
ผู้เขียน

still nothing appears in event/questions

Related Posts ตอบกลับ มุมมอง กิจกรรม
3
พ.ค. 25
2680
0
ธ.ค. 23
2389
1
ก.ค. 23
2439
0
ก.ค. 22
1901
2
ต.ค. 24
7920