<openerp>
    <data>

        <record id="action_claim_from_delivery" model="ir.actions.act_window">
            <field name="name">Claim From Delivery</field>
            <field name="res_model">crm.claim</field>
            <field name="view_type">form</field>
            <field name="view_id" ref="crm_claim.crm_case_claims_tree_view"/>
            <field name="context">{'default_ref': 'stock.picking.out,'+str(context.get('active_id', False))}</field>
            <field name="domain">[('ref','=','stock.picking.out,'+str(context.get('active_id',False)))]</field>
        </record>

        <record id="crm_claim_from_delivery" model="ir.ui.view">
            <field name="name">crm.claim.from_delivery.form</field>
            <field name="model">stock.picking.out</field>
            <field name="inherit_id" ref="stock.view_picking_out_form"/>
            <field name="arch" type="xml">
                <xpath expr="/form/sheet/h1" position="before">
                    <div class="oe_right oe_button_box">
                        <button name="%(action_claim_from_delivery)d" string="Claims" type="action"/>
                    </div>
                </xpath>
            </field>
        </record>

    </data>
</openerp>
