<odoo>
  <data>

    <record model="ir.ui.view" id="kalachakra.membership_list">
      <field name="name">kalachakra_member list</field>
      <field name="model">kalachakra.membership</field>
      <field name="arch" type="xml">
        <tree default_order='create_date desc'>
          
          <field name="create_date"/>
          <field name="partner_id"/>
          <field name="product_id"/>
          <field name="amount"/>
          <field name="state"/>
          <field name="start_date"/>
          <field name="end_date"/>
        </tree>
      </field>
    </record>

    <record model="ir.ui.view" id="kalachakra.membership_form">
      <field name="name">kalachakra_member form</field>
      <field name="model">kalachakra.membership</field>
      <field name="arch" type="xml">
        <form>
        <header>
        <button name="email_confirmation" type="object" string="Send email confirmation"/>
        </header>
        <sheet>
          <group>
          <field name="partner_id" widget="res_partner_many2one" context="{'show_address': 1}"/>
          <field name="firstname"/>
          <field name="email"/>
          <field name="product_id"/>
          <field name="start_date"/>
          <field name="end_date"/>
          <field name="amount"/>
          <field name="state"/>
          </group>
          <group>
          <field name="invoice_id"/>
          <field name="transaction_id"/>
          <field name="payment_state"/>

          </group>
          <group>
          <field name="create_date"/>
          </group>
          </sheet>
          
          
          
          
        </form>
      </field>
    </record>


    <record model="ir.actions.act_window" id="membership_action">
      <field name="name">Memberships</field>
      <field name="res_model">kalachakra.membership</field>
      <field name="view_mode">tree,form,pivot</field>
    </record>

<record id="view_membership_search" model="ir.ui.view">                                
  <field name="name">kalachakra.membership.search</field>                                
  <field name="model">kalachakra.membership</field>                                
  <field name="arch" type="xml">                                    
    <search string="Search">                                        
      <field name="partner_id"></field> 
      <filter string="valid memberships" domain="[('end_date','&gt;=',datetime.datetime.now())]" name="valid_membership"></filter>
      <filter string="memberships of the current year" domain="[('start_date','&lt;=', time.strftime('%%Y-12-31')),('start_date','&gt;=',time.strftime('%%Y-01-01'))]" name="current_year"></filter>                                       
      
    </search>                                
  </field>                            
</record>

 

<menuitem id="membership_top_menu" sequence="16"
        name="Memberships" web_icon="kalachakra,static/description/membership.png"/>

<menuitem id="membership_title_menu" parent="membership_top_menu"
        sequence="15" name="Memberships"/>

<menuitem id="membership_menu" action="membership_action"
        parent="membership_title_menu" sequence="10"/>

</data>
</odoo>