File: phone_blacklist_views.xml

package info (click to toggle)
odoo 18.0.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 878,716 kB
  • sloc: javascript: 927,937; python: 685,670; xml: 388,524; sh: 1,033; sql: 415; makefile: 26
file content (75 lines) | stat: -rw-r--r-- 2,971 bytes parent folder | download
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
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <record id="phone_blacklist_view_tree" model="ir.ui.view">
        <field name="name">phone.blacklist.view.list</field>
        <field name="model">phone.blacklist</field>
        <field name="arch" type="xml">
            <list string="Phone Blacklist" sample="1">
                <field name="create_date" string="Blacklist Date"/>
                <field name="number"/>
            </list>
        </field>
    </record>

    <record id="phone_blacklist_view_form" model="ir.ui.view">
        <field name="name">phone.blacklist.view.form</field>
        <field name="model">phone.blacklist</field>
        <field name="arch" type="xml">
            <form string="Phone Blacklist" duplicate="false">
                <header>
                    <button name="phone_action_blacklist_remove" string="Unblacklist"
                        type="object" class="oe_highlight" context="{'default_phone': number}"
                        invisible="not active or not number"/>
                    <button name="action_add" string="Blacklist"
                        type="object" class="oe_highlight"
                        invisible="active or not number"/>
                </header>
                <sheet>
                    <div class="badge rounded-pill text-bg-danger float-end fs-6 border-0" invisible="active">Archived</div>
                    <group>
                        <field name="number"/>
                    </group>
                </sheet>
                <chatter/>
            </form>
        </field>
    </record>

    <record id="phone_blacklist_view_search" model="ir.ui.view">
        <field name="name">phone.blacklist.view.search</field>
        <field name="model">phone.blacklist</field>
        <field name="arch" type="xml">
            <search>
                <field name="number"/>
                <filter string="Archived" name="inactive" domain="[('active','=',False)]"/>
            </search>
        </field>
    </record>

    <record id="phone_blacklist_action" model="ir.actions.act_window">
        <field name="name">Blacklisted Phone Numbers</field>
        <field name="res_model">phone.blacklist</field>
        <field name="view_id" ref="phone_blacklist_view_tree"/>
        <field name="search_view_id" ref="phone_blacklist_view_search"/>
        <field name="help" type="html">
            <p class="o_view_nocontent_smiling_face">
                Add a phone number in the blacklist
            </p><p>
                Blacklisted phone numbers won't receive SMS Mailings anymore.
            </p>
        </field>
    </record>

    <!-- Technical Menu -->
    <menuitem id="phone_menu_main"
        name="Phone / SMS"
        parent="base.menu_custom"
        sequence="3"/>

    <menuitem id="phone_blacklist_menu"
        name="Phone Blacklist"
        parent="phone_validation.phone_menu_main"
        sequence="3"
        action="phone_blacklist_action"/>

</odoo>