<openerp>
  <data>

    <record id="invoice_form_customer_group_invoice" model="ir.ui.view">
      <field name="name">Show Cancel invoice button customer</field>
      <field name="model">account.invoice</field>
      <field name="inherit_id" ref="account.invoice_form" />
      <field name="type">form</field>
      <field name="arch" type="xml">
        <xpath expr="//button[@name='invoice_cancel']"  position="attributes">
          <attribute name="groups">account.group_account_invoice</attribute>
        </xpath>
      </field>
    </record>


    <!-- restore cancel button for open state -->
    <record id="invoice_form_supplier_group_invoice" model="ir.ui.view">
      <field name="name">Show Cancel invoice button supplier</field>
      <field name="model">account.invoice</field>
      <field name="inherit_id" ref="account.invoice_supplier_form" />
      <field name="type">form</field>
      <field name="arch" type="xml">
        <xpath expr="//button[@name='invoice_cancel']" position="after">
          <button name="invoice_cancel" states="open" string="Cancel Invoice" groups="account.group_account_invoice"/>
        </xpath>
      </field>
    </record>


  </data>
</openerp>
