<?xml version="1.0"?>
<form string="Meetings" js_class="calendar_form">
                <div invisible="not recurrence_id" class="alert alert-info oe_edit_only" role="status">
                    <p>Edit recurring event</p>
                    <field name="recurrence_update" widget="radio"/>
                </div>
                <sheet>
                    <div class="oe_button_box" name="button_box">
                        <button icon="fa-bars" type="object" name="action_open_calendar_event" invisible="not (res_id and res_model_name)">
                            <field name="res_model_name"/>
                        </button>
                    </div>
                    <widget name="web_ribbon" title="Archived" bg_color="text-bg-danger" invisible="active"/>
                    <field name="res_id" invisible="1"/>
                    <field name="active" invisible="1"/>
                    <field name="user_can_edit" invisible="1"/>
                    <field name="invalid_email_partner_ids" invisible="1"/> <!-- this field will be used in
                        many2many_attendees widget -->
                    <div class="oe_title mb-3">
                        <div>
                            <label for="name"/>
                        </div>
                        <h1>
                            <field name="name" placeholder="e.g. Business Lunch" readonly="not user_can_edit"/>
                        </h1>
                    </div>
                    <group>
                        <group>
                            <field name="start_date" widget="daterange" options="{'end_date_field': 'stop_date'}" invisible="not allday" required="allday" readonly="not user_can_edit"/>
                            <field name="start" widget="daterange" options="{'end_date_field': 'stop'}" invisible="allday" required="not allday" readonly="not user_can_edit"/>
                            <field name="stop_date" invisible="1"/>
                            <field name="stop" invisible="1"/>
                            <label for="duration" class="fw-bold text-900 opacity-100"/>
                            <div class="d-flex gap-2">
                                <div class="d-flex align-items-start" invisible="allday">
                                    <field name="duration" widget="float_time" string="Duration" class="oe_inline pe-2" readonly="(id and recurrency) or not user_can_edit"/>
                                    <span> hours</span>
                                </div>
                                <span invisible="allday" style="white-space: pre;"> or </span>
                                <div class="d-flex gap-2">
                                    <label for="allday" class=""/>
                                    <field name="allday" class="oe_inline" widget="boolean_toggle" force_save="1" options="{'autosave': False}" readonly="not user_can_edit"/>
                                </div>
                            </div>
                            <field name="event_tz" invisible="not recurrency" readonly="not user_can_edit"/>


                            <field name="recurrence_id" invisible="1"/>
                            <field name="rrule_type" invisible="1"/>
                            <field name="recurrency" readonly="not user_can_edit"/>
                            <field name="rrule_type_ui" class="w-auto" invisible="not recurrency" required="recurrency" readonly="not user_can_edit"/>
                            <label for="interval" class="fw-bold text-900" invisible="not recurrency or rrule_type_ui != 'custom'"/>
                            <div class="d-flex gap-1" invisible="not recurrency or rrule_type_ui != 'custom'">
                                <field name="interval" string="Repeat every" class="oe_inline w-auto"/>
                                <field name="rrule_type" nolabel="1" class="oe_inline" required="rrule_type_ui == 'custom'"/>
                            </div>
                            <span class="fw-bold text-nowrap" invisible="rrule_type_ui not in ['weekly', 'custom'] or (rrule_type_ui == 'custom' and rrule_type != 'weekly')">Repeat on</span>
                            <div invisible="rrule_type_ui not in ['weekly', 'custom'] or (rrule_type_ui == 'custom' and rrule_type != 'weekly')"><widget name="calendar_week_days" readonly="not user_can_edit"/></div>
                            <field name="recurrence_id" invisible="1"/>

                            <label string="Day of Month" for="month_by" class="fw-bold text-900" style="width: fit-content;" invisible="rrule_type_ui not in ['monthly', 'custom'] or (rrule_type_ui == 'custom' and rrule_type != 'monthly')"/>
                            <div class="d-flex gap-2" invisible="rrule_type_ui not in ['monthly', 'custom'] or (rrule_type_ui == 'custom' and rrule_type != 'monthly')">
                                <field name="month_by" nolabel="1" class="oe_inline w-auto" required="rrule_type_ui == 'monthly' or rrule_type == 'monthly'"/>
                                <field name="day" nolabel="1" class="oe_inline w-auto" required="(rrule_type_ui == 'monthly' or rrule_type == 'monthly') and month_by == 'date'" invisible="month_by != 'date'"/>
                                <field name="byday" string="The" class="oe_inline w-auto" nolabel="1" required="(rrule_type_ui == 'monthly' or rrule_type == 'monthly') and month_by == 'day'" invisible="month_by != 'day'"/>
                                <field name="weekday" nolabel="1" class="oe_inline w-auto" required="(rrule_type_ui == 'monthly' or rrule_type == 'monthly') and month_by == 'day'" invisible="month_by != 'day'"/>
                            </div>
                            <label string="Until" for="end_type" class="fw-bold text-900" invisible="not recurrency"/>
                            <div class="d-flex gap-2" invisible="not recurrency">
                                <field name="end_type" class="oe_inline w-auto" nolabel="1" required="recurrency" readonly="not user_can_edit"/>
                                <field name="count" class="oe_inline w-auto" nolabel="1" invisible="end_type != 'count'" required="recurrency" readonly="not user_can_edit"/>
                                <field name="until" class="oe_inline w-auto" nolabel="1" invisible="end_type != 'end_date'" readonly="not user_can_edit" required="recurrency and end_type == 'end_date'" placeholder="e.g: 12/31/2023"/>
                            </div>

                            <field name="location" placeholder="Online Meeting" readonly="not user_can_edit"/>
                            <label for="videocall_location" class="opacity-100"/>
                            <div name="videocall_location_div" col="2">
                                <field name="videocall_location" string="Videocall URL" widget="CopyClipboardChar" force_save="1" readonly="videocall_source == 'discuss' or not user_can_edit"/>
                                <button name="clear_videocall_location" type="object" class="btn btn-link ps-0" invisible="not videocall_location or not user_can_edit" context="{'recurrence_update': recurrence_update}">
                                    <span class="fa fa-times"/><span> Clear meeting</span>
                                </button>
                                <button name="set_discuss_videocall_location" type="object" class="btn btn-link ps-0" invisible="videocall_location or not user_can_edit" context="{'recurrence_update': recurrence_update}">
                                    <span class="fa fa-plus"/><span> Odoo meeting</span>
                                </button>
                                <button name="action_join_video_call" class="btn btn-link" help="Join Video Call" type="object" invisible="not videocall_location or not user_can_edit">
                                    <span class="oi oi-arrow-right"/><span> Join video call</span>
                                </button>
                            </div>
                            <field name="videocall_source" invisible="1"/>
                            <field name="access_token" invisible="1" force_save="1"/>
                            <field name="categ_ids" widget="many2many_tags" options="{'color_field': 'color', 'no_create_edit': True}" readonly="not user_can_edit"/>
                            <label for="privacy"/>
                                    <div class="o_row">
                                        <field name="show_as" readonly="not user_can_edit" nolabel="1"/>
                                        <field name="privacy" readonly="not user_can_edit" nolabel="1" placeholder="Default"/>
                                    </div>
                                    <field name="user_id" widget="many2one_avatar_user" readonly="not user_can_edit"/>
                                    <field name="description" options="{'height': 100}" placeholder="Add description" readonly="not user_can_edit"/>
                        </group>
                        <group>
                            <field name="should_show_status" invisible="1"/>
                            <field name="current_status" class="w-auto" required="should_show_status" readonly="not should_show_status" invisible="not should_show_status"/>
                            <field name="alarm_ids" widget="many2many_tags" options="{'no_quick_create': True}" readonly="not user_can_edit"/>
                            <div class="o_row" colspan="2">
                                <div colspan="1">
                                    <field name="attendees_count" class="w-auto oe_inline" nolabel="1"/><span> Attendees</span>
                                </div>
                                <div name="send_buttons" class="d-flex gap-2 justify-content-end" colspan="1">
                                    <button name="action_open_composer" help="Send Email to attendees" type="object" string=" EMAIL" icon="fa-envelope" invisible="not user_can_edit"/>
                                </div>
                            </div>
                            <div colspan="2">
                                <field name="accepted_count" class="w-auto oe_inline" nolabel="1"/> yes,
                                <field name="tentative_count" class="w-auto oe_inline" nolabel="1"/> maybe,
                                <field name="declined_count" class="w-auto oe_inline" nolabel="1"/> no,
                                <field name="awaiting_count" class="w-auto oe_inline" nolabel="1"/> awaiting
                            </div>
                            <div class="d-flex align-items-baseline" colspan="2">
                                <field name="partner_ids" widget="many2manyattendee" placeholder="Select attendees..." options="{'no_quick_create': True}" context="{'form_view_ref': 'base.view_partner_simple_form'}" domain="[('type','!=','private')]" class="oe_inline" readonly="not user_can_edit"/>
                            </div>
                        </group>
                    </group>
                    <notebook>
                        <page name="page_invitations" string="Invitations" groups="base.group_no_one" invisible="not user_can_edit">
                            <button name="action_sendmail" type="object" string="Send Invitations" icon="fa-envelope" class="oe_link"/>
                            <field name="attendee_ids" widget="one2many" mode="list,kanban" readonly="1">
                                <list string="Invitation details" editable="top" create="false" delete="false">
                                    <field name="partner_id"/>
                                    <field name="email" widget="email"/>
                                    <field name="phone" widget="phone"/>
                                    <field name="state"/>
                                    <button name="do_tentative" invisible="state not in ('needsAction', 'declined', 'accepted')" string="Uncertain" type="object" icon="fa-asterisk"/>
                                    <button name="do_accept" string="Accept" invisible="state not in ('needsAction', 'tentative', 'declined')" type="object" icon="fa-check text-success"/>
                                    <button name="do_decline" string="Decline" invisible="state not in ('needsAction', 'tentative', 'accepted')" type="object" icon="fa-times-circle text-danger"/>
                                </list>
                                <kanban class="o_kanban_mobile" create="false" delete="false">

                                    <templates>
                                        <t t-name="card">
                                            <field name="partner_id"/>
                                            <field name="email" widget="email"/>
                                            <span>Status: <field name="state"/></span>
                                            <footer class="justify-content-end">
                                                <button name="do_tentative" invisible="state not in ('needsAction', 'declined', 'accepted')" string="Uncertain" type="object" class="btn fa fa-asterisk"/>
                                                <button name="do_accept" invisible="state not in ('needsAction', 'tentative', 'declined')" string="Accept" type="object" class="btn fa fa-check text-success"/>
                                                <button name="do_decline" invisible="state not in ('needsAction', 'tentative', 'accepted')" string="Decline" type="object" class="btn fa fa-times-circle text-danger"/>
                                            </footer>
                                        </t>
                                    </templates>
                                </kanban>
                            </field>
                        </page>
                    </notebook>
                </sheet>
                <chatter/>
            </form>
        