Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
2413 Widoki

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?

Awatar
Odrzuć
Najlepsza odpowiedź

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


Awatar
Odrzuć
Autor

still nothing appears in event/questions

Powiązane posty Odpowiedzi Widoki Czynność
3
maj 25
2453
0
gru 23
2306
1
lip 23
2270
0
lip 22
1859
2
paź 24
7862