<?xml version="1.0" encoding="utf-8" ?>
<odoo>

<!-- <record model="ir.ui.view" id="partner_category_list">
      <field name="name">partner category list</field>
      <field name="model">event.partner_category</field>
      <field name="arch" type="xml">
        <tree>
          <field name="partner_category_id"/>
          <field name="status"/>
        </tree>
      </field>
    </record> -->

<!-- <record model="ir.ui.view" id="membership_product_list">
      <field name="name">Membership product list</field>
      <field name="model">event.membership_product</field>
      <field name="arch" type="xml">
        <tree>
          <field name="membership_product_id"/>
         
        </tree>
      </field>
    </record> -->

    <record id="booking_event_type_view_form" model="ir.ui.view">
        <field name="name">event.type.view.form.inherit.booking</field>
        <field name="model">event.type</field>
        <field name="inherit_id" ref="event.view_event_type_form" />
        <field name="arch" type="xml">
            <xpath expr="//div[@class='oe_title']" position="after">
            <div class="row o_settings_container" name="event_type_booking">
                <div class="col-12 col-lg-8 o_setting_box">
                                    <div class="o_setting_left_pane">
                                        <field name="booking_event"/>
                                    </div>
                                     <div class="o_setting_right_pane">
                                        <label for="booking_event"/>
                                        
                                        <div class="row mt16" attrs="{'invisible': [('booking_event', '=', False)]}">
                                            <div class="col-12">
                                                <label for="booking_questionnaire_id"/>
                                                <field name="booking_questionnaire_id"/>
                                                <field name="booking_option_ids" style="width: 100%;">
                                                    <tree string="Options" editable="bottom">
                                                        <field name="booking_option_id"/>
                                                        <field name="booking_option_price" />
                                                        <field name="booking_option_member_price" />
                                                        <field name="booking_option_super_member_price" />
                                                        
                                                    </tree>
                                                </field>
                                            </div>
                                        </div>
                                    </div>
                                    
                </div>

            </div>
            
                                    
                                    
                                
            </xpath>

            

        </field>
</record>

<record id="booking_event_view_form" model="ir.ui.view">
        <field name="name">event.view.form.inherit.booking</field>
        <field name="model">event.event</field>
        <field name="inherit_id" ref="event.view_event_form" />
        <field name="arch" type="xml">
            <xpath expr="//div[@class='oe_title']" position="after">
            <div class="row o_settings_container" name="event_type_booking">
                <div class="col-12 col-lg-2 o_setting_box">
                                    <div class="o_setting_left_pane">
                                        <field name="booking_event"/>
                                        <field name="individual_booking_event"/>
                                    </div>
                                     <div class="o_setting_right_pane">
                                    <label for="booking_event"/>
                                     <label for="individual_booking_event"/>
                                     </div>
                                    
                </div>
            </div>
            </xpath>
             
            <xpath expr="//page[@name='tickets']" position="before">
            <page string="Prices" name="booking" attrs="{'invisible':[('booking_event','=',False)]}">
            <group style="width:25%%">
            
            <field name="booking_product_id" attrs="{'required': [('booking_event','=', True)]}"/>
             <field name="booking_price" attrs="{'required': [('booking_event','=', True)]}"/>
             <field name="booking_member_price" attrs="{'required': [('booking_event','=', True)]}"/>
             <field name="booking_super_member_price" attrs="{'required': [('booking_event','=', True)]}"/>
             <field name="booking_down_payment" attrs="{'required': [('booking_event','=', True)]}"/>
            </group>
            </page>
            </xpath>
            <xpath expr="//page[@name='booking']" position="after">
            <page string="Options" name="booking_options" attrs="{'invisible':['|',('booking_event','=',False),('individual_booking_event','=',True)]}">
            <group style="width:100%%">
             <field name="booking_option_ids" style="width: 100%;">
                <tree string="Options" editable="bottom">
                    <field name="booking_option_id"/>
                    <field name="booking_option_price" />
                    <field name="booking_option_member_price" />
                    <field name="booking_option_super_member_price" />
                    
                </tree>
            </field>
            </group>
            </page>
            <page string="Questions" name="booking_questions" attrs="{'invisible':[('booking_event','=',False)]}">
            <group style="width:100%%">
             <field name="questionnaire_id" style="width: 100%;"/>
             <field name="question_ids" style="width: 100%;">
                <tree string="Questions">
                    <field name="question"/>
                    
                </tree> 
            </field>
            </group>
            </page>
            <page string="Individual Prices" name="individual booking price" attrs="{'invisible':['|',('booking_event','=',False),('individual_booking_event','=',False)]}">
            <group style="width:25%%">
            
             <field name="individual_day_price" attrs="{'required': [('individual_booking_event','=', True)]}"/>
             <field name="individual_member_day_price" attrs="{'required': [('individual_booking_event','=', True)]}"/>
             <field name="individual_super_member_day_price" attrs="{'required': [('individual_booking_event','=', True)]}"/>
            
            </group>
            <group style="width:25%%">
            
             <field name="individual_week_price" attrs="{'required': [('individual_booking_event','=', True)]}"/>
             <field name="individual_member_week_price" attrs="{'required': [('individual_booking_event','=', True)]}"/>
             <field name="individual_super_member_week_price" attrs="{'required': [('individual_booking_event','=', True)]}"/>
            
            </group>
            <group style="width:25%%">
            
             <field name="individual_2weeks_price" attrs="{'required': [('individual_booking_event','=', True)]}"/>
             <field name="individual_member_2weeks_price" attrs="{'required': [('individual_booking_event','=', True)]}"/>
             <field name="individual_super_member_2weeks_price" attrs="{'required': [('individual_booking_event','=', True)]}"/>
            
            </group>
            <group style="width:25%%">
            
             <field name="individual_3weeks_price" attrs="{'required': [('individual_booking_event','=', True)]}"/>
             <field name="individual_member_3weeks_price" attrs="{'required': [('individual_booking_event','=', True)]}"/>
             <field name="individual_super_member_3weeks_price" attrs="{'required': [('individual_booking_event','=', True)]}"/>
            
            </group>
            <group style="width:25%%">
            
             <field name="individual_month_price" attrs="{'required': [('individual_booking_event','=', True)]}"/>
             <field name="individual_member_month_price" attrs="{'required': [('individual_booking_event','=', True)]}"/>
             <field name="individual_super_member_month_price" attrs="{'required': [('individual_booking_event','=', True)]}"/>
            
            </group>
            <group>
            <field string="Introduction text page 1" widget="html" name="individual_booking_html_introduction"/>
            <field string="Introduction text page 2" widget="html" name="individual_booking_html_introduction2"/>
            </group>
            </page>
            </xpath>
            <xpath expr="//page[@name='tickets']" position="replace">
            </xpath>
            <xpath expr="//field[@name='stage_id']" position="before">
            <button type="object" name="csv_booking_registrants"  string="Export registrants"
              attrs="{'invisible':[('booking_event','=',False)]}"       />
            </xpath>
            
        </field>
</record>

<!-- <record model="ir.actions.act_window" id="partner_category_action">
      <field name="name">Partner categories</field>
      <field name="res_model">event.partner_category</field>
      <field name="view_mode">tree,form</field>
</record> -->

<!-- <record model="ir.actions.act_window" id="membership_product_action">
      <field name="name">Membership product</field>
      <field name="res_model">event.membership_product</field>
      <field name="view_mode">tree,form</field>
</record> -->



<!-- <menuitem id="booking_partner_category_menu" action="partner_category_action" 
parent="booking_title_menu" groups="event.group_event_user" sequence="2"/> -->

<!-- <menuitem id="booking_membership_product__menu" action="membership_product_action" 
parent="booking_title_menu" groups="event.group_event_user" sequence="3"/> -->

<record model="ir.actions.act_window" id="booking_event_action">
      <field name="name">Booking events</field>
      <field name="res_model">event.event</field>
      <field name="view_mode">tree,form,pivot</field>
      <field name="context">{'default_booking_event': True, 'booking_event_view': True}</field>
      <field name="domain">[('booking_event', '=', True)]</field>
    </record>



<menuitem id="booking_event_top_menu" sequence="20"
        name="Booking Events" web_icon="kalachakra_theme,static/src/img/icons/Events.png"/>

<menuitem id="booking_title_menu" name ="Booking"
        parent="booking_event_top_menu" groups="event.group_event_user" sequence="99"/>
        
<menuitem id="booking_event_title_menu" parent="booking_event_top_menu"
        sequence="15" name="booking events"/>

<menuitem id="booking_event_menu" action="booking_event_action"
        parent="booking_event_title_menu" sequence="10"/>

</odoo>