phone_blacklist_views.xml 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <odoo>
  3. <record id="phone_blacklist_view_tree" model="ir.ui.view">
  4. <field name="name">phone.blacklist.view.tree</field>
  5. <field name="model">phone.blacklist</field>
  6. <field name="arch" type="xml">
  7. <tree string="Phone Blacklist">
  8. <field name="create_date" string="Blacklist Date"/>
  9. <field name="number"/>
  10. </tree>
  11. </field>
  12. </record>
  13. <record id="phone_blacklist_view_form" model="ir.ui.view">
  14. <field name="name">phone.blacklist.view.form</field>
  15. <field name="model">phone.blacklist</field>
  16. <field name="arch" type="xml">
  17. <form string="Phone Blacklist" duplicate="false" edit="false">
  18. <header>
  19. <button name="phone_action_blacklist_remove" string="Unblacklist"
  20. type="object" class="oe_highlight" context="{'default_phone': number}"
  21. attrs="{'invisible': ['|', ('active', '=', False), ('number', '=', False)]}"/>
  22. <button name="action_add" string="Blacklist"
  23. type="object" class="oe_highlight"
  24. attrs="{'invisible': ['|', ('active', '=', True), ('number', '=', False)]}"/>
  25. </header>
  26. <sheet>
  27. <widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
  28. <group>
  29. <group>
  30. <field name="number"/>
  31. <field name="active" readonly="1"/>
  32. <br/>
  33. </group>
  34. </group>
  35. </sheet>
  36. <div class="oe_chatter">
  37. <field name="message_follower_ids"/>
  38. <field name="message_ids"/>
  39. </div>
  40. </form>
  41. </field>
  42. </record>
  43. <record id="phone_blacklist_view_search" model="ir.ui.view">
  44. <field name="name">phone.blacklist.view.search</field>
  45. <field name="model">phone.blacklist</field>
  46. <field name="arch" type="xml">
  47. <search>
  48. <field name="number"/>
  49. <filter string="Archived" name="inactive" domain="[('active','=',False)]"/>
  50. </search>
  51. </field>
  52. </record>
  53. <record id="phone_blacklist_action" model="ir.actions.act_window">
  54. <field name="name">Blacklisted Phone Numbers</field>
  55. <field name="res_model">phone.blacklist</field>
  56. <field name="view_id" ref="phone_blacklist_view_tree"/>
  57. <field name="search_view_id" ref="phone_blacklist_view_search"/>
  58. <field name="help" type="html">
  59. <p class="o_view_nocontent_smiling_face">
  60. Add a phone number in the blacklist
  61. </p><p>
  62. Blacklisted phone numbers won't receive SMS Mailings anymore.
  63. </p>
  64. </field>
  65. </record>
  66. <!-- Technical Menu -->
  67. <menuitem id="phone_menu_main"
  68. name="Phone / SMS"
  69. parent="base.menu_custom"
  70. sequence="3"/>
  71. <menuitem id="phone_blacklist_menu"
  72. name="Phone Blacklist"
  73. parent="phone_validation.phone_menu_main"
  74. sequence="3"
  75. action="phone_blacklist_action"/>
  76. </odoo>