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

Hi everyone, 

I'm using Odoo 10, and I'm improving some features of calendar module.

When click on a meeting event, a popup modal will be shown with event summary and 3 buttons: "Edit", "Delete" and "Close".

I known the action popup and the view definition in calendar_views.xml. But for the buttons in popup footer, I cannot find it and how to add more button to the footer?

The calendar view:

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

        <field name="name">calendar.event.calendar</field>
        <field name="model">calendar.event</field>
        <field name="priority" eval="2"/>
        <field name="arch" type="xml">
            <calendar string="Meetings" date_start="start" date_stop="stop" date_delay="duration" all_day="allday"
                         display="[name]" color="color_partner_id" attendee="partner_ids" avatar_model="res.partner"
                         use_contacts="True" event_open_popup="%(calendar.view_calendar_event_form_popup)s">
                <field name="name"/>
                <field name="user_id"/>
                <field name="color_partner_id"/>
                <field name="partner_ids"/>
            </calendar>
        </field>
    </record>

And the popup form view:

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

        <field name="name">calendar.event.form</field>
        <field name="model">calendar.event</field>
        <field name="priority" eval="2"/>
        <field name="arch" type="xml">
            <form string="Meetings">
                <field name="state" invisible="1"/>
                <field name="is_attendee" invisible="1"/>
                <field name="attendee_status" invisible="1"/>
                <group>
                    <group>
                        <field name="start_date" string="Starting at" attrs="{'invisible': [('allday','=',False)]}"/>
                        <field name="start_datetime" string="Starting at" attrs="{'invisible': [('allday','=',True)]}"/>
                        <label for="duration" attrs="{'invisible': [('allday','=',True)]}"/>
                        <div attrs="{'invisible': [('allday','=',True)]}">
                            <field name="duration" widget="float_time" class="oe_inline"/>
                            <span> hours</span>
                        </div>
                        <field name="allday" class="oe_inline" attrs="{'invisible': [('allday','=',False)]}"/>
                        <field name="partner_ids" widget="many2manyattendee" string="Attendees"/>
                    </group>
                    <group>
                        <field name="location"/>
                        <field name="categ_ids" widget="many2many_tags"/>
                        <field name="alarm_ids" widget="many2many_tags" />
                    </group>
                </group>
            </form>
        </field>
    </record>


Thank you

Avatar
Discard
Best Answer

I have this problem with this popup and with the form view footer "when you click on edit on that popup view".
could anyone help? 

I know that one of the best way is using t-extend tag but I couldn't find the right xml for it.

Avatar
Discard
Best Answer

Hi Vuhynk,

some time has passed since your request, so I image and I (hope) that you may already find a solution. Anyway, I'll write a possible solution here, as it may be useful for other people with are trying to solve the same problem.

Usually, when there is the tag <footer> within the view you can modify it just by using something like:

<xpath expr="//footer" position="inside">

    <button name="your_button_goes_here"/>

</xpath>

However, since the footer tag is not present in the view you'll need to add it before the form. In this specific case, it means you need to add  the footer after the first group close:

<xpath expr="//group[1]" position="after">
<footer>
     <your_buttons_here/>
</footer>
</xpath>


NOTE: YOU'LL NEED TO RE-ADD ALL THE ORIGINAL BUTTON, AS THIS WILL WORK LIKE A FULL REPLACE OF THE FOOTER. HOPE IT MAY BE HELPFUL FOR SOMEONE.
Avatar
Discard