<?xml version="1.0"?>
<openerp>
    <data>
        <record model="ir.ui.view" id="view_synchronize_google_contact_import_form">
            <field name="name">synchronize.base.form</field>
            <field name="model">synchronize.google.import</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Import contacts from a google account">
                    <group colspan="4" col="4" width="430">
                       <field name="group_name" colspan="4"/>
                       <separator string="Import Options" colspan="4"/>
                       <field name="create_partner" colspan="4"/>
                       <newline/>
                       <group attrs="{'invisible': [('create_partner','!=','create_all')]}" colspan="4" col="4">
                            <separator string="Partner status for this group:" colspan="4"/>
                            <field name="customer" colspan="4"/>
                            <field name="supplier"  colspan="4"/>
                       </group>
                    </group>
                    <separator string="" colspan="4"/>
                    <group colspan="4" col="4">
                        <group colspan="2" col="2"/>
                        <group colspan="2" col="2">
                            <button special="cancel" string="_Cancel" icon="gtk-cancel"/>
                            <button name="import_google" string="_Import Contacts" type="object" icon="terp-personal+"/>
                        </group>
                    </group>
                </form>
            </field>
        </record>



        <record model="ir.ui.view" id="view_synchronize_google_calendar_import_form">
            <field name="name">synchronize.google.calendar.form</field>
            <field name="model">synchronize.google.import</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Import Google Calendar Events">
                    <group colspan="4" col="4" width="320">
                       <field name="calendar_name" />
                    </group>
                    <separator string="" colspan="4"/>
                    <group colspan="4" col="4">
                        <group colspan="2" col="2"/>
                        <group colspan="2" col="2">
                            <button special="cancel" string="_Cancel" icon="gtk-cancel"/>
                            <button name="import_google" string="_Import Events" type="object" icon="terp-calendar"/>
                        </group>
                    </group>
                </form>
            </field>
        </record>
        <!--
            Login Action
        -->
        <record model="ir.actions.act_window" id="act_google_login_form">
          <field name="name">Import Google Calendar</field>
          <field name="type">ir.actions.act_window</field>
          <field name="res_model">google.login</field>
          <field name="view_type">form</field>
          <field name="view_mode">form</field>
          <field name="target">new</field>
          <field name="context">{'calendar':True}</field>
          <field name="view_id" ref="google_base_account.view_google_login_form" />
        </record>

        <record model="ir.actions.act_window" id="act_google_login_contact_form">
          <field name="name">Import Google Contacts</field>
          <field name="type">ir.actions.act_window</field>
          <field name="res_model">google.login</field>
          <field name="view_type">form</field>
          <field name="view_mode">form</field>
          <field name="target">new</field>
          <field name="context">{'contact':True}</field>
          <field name="view_id" ref="google_base_account.view_google_login_form" />
        </record>

        <menuitem id="menu_sync_contact"
                  parent="base.menu_address_book"
                  action="act_google_login_contact_form"
                  sequence="40" />

        <menuitem id="menu_sync_calendar"
                  parent="crm.menu_meeting_sale"
                  action="act_google_login_form"
                  sequence="20" />

    </data>
</openerp>
