summaryrefslogtreecommitdiff
path: root/addons/coupon/views/coupon_views.xml
blob: 67bdd3b31770fa167ad58ee2a0f2fe809f568a05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="coupon_view_tree" model="ir.ui.view">
        <field name="name">coupon.coupon.tree</field>
        <field name="model">coupon.coupon</field>
        <field name="arch" type="xml">
            <tree string="Coupons" create="false" edit="false" delete="false">
                <field name="code"/>
                <field name="expiration_date"/>
                <field name="program_id"/>
                <field name="partner_id"/>
                <field name="state"/>
            </tree>
        </field>
    </record>

    <record id="coupon_action" model="ir.actions.act_window">
        <field name="name">Coupons</field>
        <field name="res_model">coupon.coupon</field>
        <field name="view_id" ref="coupon_view_tree"/>
        <field name="domain">[('program_id', '=', active_id)]</field>
        <field name="context">{}</field>
    </record>


    <record id="coupon_view_form" model="ir.ui.view">
        <field name="name">coupon.coupon.form</field>
        <field name="model">coupon.coupon</field>
        <field name="arch" type="xml">
            <form string="Coupons" create="false" edit="false" delete="false">
                <header>
                    <button name="action_coupon_sent" type="object" string="Send by Email" class="oe_highlight" attrs="{'invisible': [('state', 'not in', ['new', 'sent'])]}"/>
                    <button name="action_coupon_cancel" type="object" string="Cancel" class="oe_highlight" attrs="{'invisible': [('state', '!=', 'new')]}"/>
                    <field name="state" widget="statusbar" statusbar_visible="new,sent,used,expired" context="{'state': state}"/>
                </header>
                <sheet>
                    <group>
                        <field name="code"/>
                        <field name="expiration_date"/>
                        <field name="partner_id"/>
                    </group>
                </sheet>
            </form>
        </field>
    </record>

</odoo>