跳至內容
選單
此問題已被標幟
1 回覆
2336 瀏覽次數

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

相關帖文 回覆 瀏覽次數 活動
3
5月 25
2354
0
12月 23
2230
1
7月 23
2185
0
7月 22
1805
2
10月 24
7774