Skip to Content
Menu
This question has been flagged
2 Replies
2633 Views

how to inherit the event module in form view

Avatar
Discard
Best Answer

Hello Jignasha,


Try this :-

In .py

class EventEvent(models.Model):

     _inherit = 'event.event'

     custom_field = fields.Char('Custom')


In .xml

<record id="event_form_view_inherit" model="ir.ui.view">

    <field name="name">event.form.view.inherit</field>

    <field name="model">event.event</field>

    <field name="inherit_id" ref="event.view_event_form"/>

    <field name="arch" type="xml">  

        <xpath expr="/form/sheet/group[@name='main_field_group']/group/field[@name='date_tz']" position="after">

             <field name="custom_field"/>

         </xpath>

     </field>

</record>


From above code, your custom field display after Timezone in Event form view.


Hope it works for you.

Thanks,

Avatar
Discard
Author

Thank u so much

Best Answer

How to make event tree, form and kanban views visible in the custom module? Tried inheriting and creating menuitems, but there is no action for the event views.

Avatar
Discard