<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="mailing_mailing_view_form" model="ir.ui.view">
        <field name="name">mailing.mailing.view.form.inherit.sale</field>
        <field name="model">mailing.mailing</field>
        <field name="inherit_id" ref="mass_mailing.view_mail_mass_mailing_form"/>
        <field name="arch" type="xml">
    		<xpath expr="//button[@id='button_view_delivered']" position="before">
                <button name="action_redirect_to_quotations"
                    type="object"
                    icon="fa-pencil-square-o"
                    class="oe_stat_button"
                    attrs="{'invisible': [('state', '=', 'draft')]}">
                    <field name="sale_quotation_count" string="Quotations" widget="statinfo"/>
                </button>
                <button name="action_redirect_to_invoiced"
                    type="object"
                    icon="fa-dollar"
                    class="oe_stat_button"
                    attrs="{'invisible': [('state', '=', 'draft')]}" >
                    <field name="sale_invoiced_amount" string="Invoiced" widget="statinfo"/>
                </button>
    		</xpath>
        </field>
    </record>
</odoo>
