<openerp>
   <data>

        <!-- crm make sale's view -->

       <record id="view_crm_make_sale" model="ir.ui.view">
          <field name="name">crm.make.sale.form</field>
          <field name="model">crm.make.sale</field>
          <field name="type">form</field>
          <field name="arch" type="xml">
              <form string="Create a Sale Order" >
              		<group width="660" height="300">
                    <group colspan="4">
                        <field name="partner_id" required="1"/>
                        <field name="shop_id" required="1" widget="selection"/>
                        <field name="analytic_account" domain="[('parent_id','!=',False)]" />
                        <field name="close" required="1"/>
                    	</group>
                            <field colspan="4" mode="tree,form,graph" name="sale_order_line" nolabel="1" widget="one2many_list">
                                <form string="Sale Order Lines">
                                    <notebook>
                                        <page string="Order Line">
                                            <field colspan="4"
                                                context="partner_id=parent.partner_id,shop=parent.shop_id"
                                                name="product_id"
                                                on_change="product_id_change(product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], True, product_packaging, False)"
                                                />
                                               <field name="product_uom_qty"/>
                                               <field name="product_uom"/>
                                            <group colspan="2" groups="product.group_uos">
                                               <field name="product_uos_qty"/>
                                               <field name="product_uos" nolabel="1"/></group>
                                            <field
                                                name="product_packaging"
                                                domain="[('product_id','=',product_id)]"
                                                groups="base.group_extended"/>
                                            <field colspan="4" name="name"/>
                                            <field name="price_unit"/>
                                            <field name="discount"/>
                                            <field name="type" groups="base.group_extended"/>
                                            <field name="delay" groups="base.group_extended"/>
                                            <newline/>
                                            <separator colspan="5" string="Taxes"/>
                                            <field colspan="4" name="tax_id" nolabel="1" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>
                                        </page>
                                        <page string="Notes">
                                            <field colspan="4" name="notes" nolabel="1"/>
                                        </page>
                                    </notebook>
                                </form>
                                <tree string="Sales order lines">
                                    <field colspan="4" name="name"/>
                                    <field name="product_uom_qty" string="Qty"/>
                                    <field name="product_uom" string="UoM"/>
                                    <field name="discount"/>
                                    <field name="price_unit"/>
                                </tree>
                            </field>
                            <newline/>


                <separator colspan="4"/>
                <group col="4" colspan="4">
                    <label string="" colspan="2"/>
                    <button special="cancel" string="_Close" icon="gtk-cancel"/>
                    <button name="makeOrder" string="_Create" type="object" icon='gtk-ok'/>
                </group>
                </group>
            </form>
          </field>
       </record>

       <!-- crm make sale's  action -->

       <record id="action_crm_make_sale" model="ir.actions.act_window">
          <field name="name">Make Quotation</field>
          <field name="type">ir.actions.act_window</field>
          <field name="res_model">crm.make.sale</field>
          <field name="view_type">form</field>
          <field name="view_mode">form</field>
          <field name="target">new</field>
       </record>

   </data>
</openerp>
