<?xml version="1.0"?>
<odoo>
    <record id="event_event_view_form_inherit_pos_event" model="ir.ui.view">
        <field name="name">event.event.view.form.inherit.pos.event</field>
        <field name="model">event.event</field>
        <field name="inherit_id" ref="event.view_event_form"/>
        <field name="arch" type="xml">
            <xpath expr="//div[hasclass('oe_title')]" position="attributes">
                <attribute name="class" add="mb-4" separator=" "/>
            </xpath>
            <xpath expr="//div[hasclass('oe_title')]" position="before">
                <field name="image_1024" widget="image" class="oe_avatar me-4"/>
            </xpath>
            <xpath expr="//button[@name='%(event.act_event_registration_from_event)d']" position="after">
                <field name="currency_id" invisible="1"/> <!-- To use currency in the button -->
                <button name="action_view_linked_pos_orders"
                        type="object" class="oe_stat_button" icon="fa-shopping-basket"
                        groups="point_of_sale.group_pos_user"
                        help="Total sales for this event from PoS">
                    <div class="o_field_widget o_stat_info">
                        <span class="o_stat_value">
                            <field name="pos_price_total"/>
                        </span>
                        <span class="o_stat_text">PoS Sales</span>
                    </div>
                </button>
            </xpath>
        </field>
    </record>
</odoo>
