<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="coupon_share_view_form" model="ir.ui.view">
        <field name="name">coupon.share.form</field>
        <field name="model">coupon.share</field>
        <field name="arch" type="xml">
            <form string="Share Loyalty Card" edit="1" create="0">
                <field name="website_id" invisible="1"/>
                <field name="program_website_id" invisible="1"/>
                <group>
                    <div colspan="2">
                        <p>
                            You can share this promotion with your customers.
                            It will be applied at checkout when the customer uses this link.
                        </p>
                    </div>
                    <field name="share_link" widget="CopyClipboardURL" no_label="1"/>
                </group>
                <group attrs="{'invisible': [('id', '!=', False)]}">
                    <group>
                        <field name="website_id" groups="website.group_multi_website" widget="selection"
                            attrs="{'invisible': [('program_website_id', '!=', False)]}"/>
                        <field name="redirect"/>
                    </group>
                </group>
                <footer>
                    <button string="Done" class="btn-primary" special="cancel" data-hotkey="z"/>
                    <button string="Generate Short Link" class="btn-secondary" type="object" name="action_generate_short_link"
                            attrs="{'invisible': ['|', ('website_id', '=', False), ('id', '!=', False)]}" data-hotkey="g"/>
                </footer>
            </form>
        </field>
    </record>
</odoo>
