summaryrefslogtreecommitdiff
path: root/indoteknik_custom/views/promotion_program_line.xml
blob: 5963d0dddb529c1ced8facab030df79e8bf2330e (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<odoo>
    <record id="promotion_program_line_tree" model="ir.ui.view">
        <field name="name">Promotion Program Line Tree</field>
        <field name="model">promotion.program.line</field>
        <field name="arch" type="xml">
            <tree>
                <field name="name" />
                <field name="promotion_type" />
                <field name="limit_qty" />
                <field name="limit_qty_user" />
                <field name="limit_qty_transaction" />
                <field name="line_free_item" />
                <field name="display_on_homepage" />
            </tree>
        </field>
    </record>

    <record id="promotion_program_line_form" model="ir.ui.view">
        <field name="name">Promotion Program Line Form</field>
        <field name="model">promotion.program.line</field>
        <field name="arch" type="xml">
            <form>
                <sheet>
                    <group>
                        <group>
                            <field name="name" />
                            <field name="promotion_type"/>
                            <field name="product_id" />
                            <field name="image" widget="image" height="160" />
                        </group>
                        <group>
                            <field name="limit_qty" />
                            <field name="limit_qty_user" />
                            <field name="limit_qty_transaction" />
                            <field 
                                name="discount_type" 
                                attrs="{'invisible': [('promotion_type', '!=', 'special_price')]}"
                            />
                            <field 
                                name="discount_amount" 
                                attrs="{'invisible': [('promotion_type', '!=', 'special_price')]}"
                            />
                            <field 
                                name="minimum_purchase_qty" 
                                attrs="{'invisible': [('promotion_type', 'not in', ['discount_loading', 'bundling', 'merchandise'])]}"
                            />
                            <field 
                                name="applies_multiply"
                                attrs="{'invisible': [('promotion_type', 'not in', ['discount_loading', 'bundling', 'merchandise'])]}"
                            />
                            <field 
                                name="display_on_homepage" 
                                attrs="{'invisible': [('promotion_type', '!=', 'special_price')]}"
                            />
                        </group>
                    </group>
                    <notebook>
                        <page 
                            string="Line Free Item" 
                            name="line_free_items" 
                            attrs="{'invisible': [('promotion_type', '=', 'special_price')]}"
                        >
                            <field name="line_free_item" />
                        </page>
                        <page
                            string="Order Line"
                            name="order_line"
                        >
                            <field name="order_line_ids" readonly="1">
                                <tree>
                                    <field name="order_id" />
                                    <field name="name" />
                                    <field name="product_id" />
                                    <field name="product_uom_qty" />
                                </tree>
                            </field>
                        </page>
                    </notebook>
                </sheet>
            </form>
        </field>
    </record>

    <record id="promotion_program_line_action" model="ir.actions.act_window">
        <field name="name">Promotion Program Line</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">promotion.program.line</field>
        <field name="view_mode">tree,form</field>
    </record>

    <menuitem
        id="menu_promotion_program_line"
        name="Program Line"
        parent="indoteknik_custom.menu_promotion_program_parent"
        sequence="2"
        action="promotion_program_line_action"
    />
</odoo>