You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

120 lines
5.6 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- © 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com>
  3. License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
  4. <odoo>
  5. <record model="ir.ui.view" id="view_mail_tracking_email_form">
  6. <field name="name">mail.tracking.email.form</field>
  7. <field name="model">mail.tracking.email</field>
  8. <field name="arch" type="xml">
  9. <form string="MailTracking event" create="false" edit="false" delete="false">
  10. <header>
  11. <field name="state" widget="statusbar"/>
  12. </header>
  13. <sheet>
  14. <group>
  15. <field name="name"/>
  16. </group>
  17. <group>
  18. <group>
  19. <field name="mail_message_id"/>
  20. <field name="mail_id"/>
  21. <field name="partner_id"/>
  22. <field name="recipient"/>
  23. <field name="sender"/>
  24. </group>
  25. <group>
  26. <field name="timestamp"/>
  27. <field name="time"/>
  28. <field name="date"/>
  29. </group>
  30. </group>
  31. <group attrs="{'invisible': [('bounce_type', '=', False)]}">
  32. <field name="bounce_type"/>
  33. <field name="bounce_description"/>
  34. </group>
  35. <group attrs="{'invisible': [('error_type', '=', False)]}">
  36. <field name="error_smtp_server"
  37. attrs="{'invisible': [('error_smtp_server', '=', False)]}"/>
  38. <field name="error_type"/>
  39. <field name="error_description"/>
  40. </group>
  41. <label for="tracking_event_ids"/>
  42. <div>
  43. <field name="tracking_event_ids">
  44. <tree string="Tracking events" colors="grey:event_type in ('deferral');black:event_type in ('send');red:event_type in ('hard_bounce', 'soft_bounce', 'spam', 'reject');blue:event_type in ('unsub', 'click', 'open')">
  45. <field name="time"/>
  46. <field name="event_type"/>
  47. <field name="ip"/>
  48. <field name="url"/>
  49. <field name="user_country_id" string="Country"/>
  50. <field name="os_family" string="OS"/>
  51. <field name="ua_family" string="User agent"/>
  52. </tree>
  53. </field>
  54. </div>
  55. </sheet>
  56. </form>
  57. </field>
  58. </record>
  59. <record model="ir.ui.view" id="view_mail_tracking_email_tree">
  60. <field name="name">mail.tracking.email.tree</field>
  61. <field name="model">mail.tracking.email</field>
  62. <field name="arch" type="xml">
  63. <tree string="MailTracking emails" create="false" edit="false" delete="false"
  64. colors="grey:state in (False, 'deferred');black:state in ('sent', 'delivered');green:state in ('opened');red:state in ('rejected', 'spam', 'bounced', 'soft-bounced');blue:state in ('unsub')">
  65. <field name="time"/>
  66. <field name="date" invisible="1"/>
  67. <field name="name"/>
  68. <field name="sender" string="Sender"/>
  69. <field name="recipient" string="Recipient"/>
  70. <field name="state"/>
  71. </tree>
  72. </field>
  73. </record>
  74. <record model="ir.ui.view" id="view_mail_tracking_email_search">
  75. <field name="name">mail.tracking.email.search</field>
  76. <field name="model">mail.tracking.email</field>
  77. <field name="arch" type="xml">
  78. <search string="MailTracking email search">
  79. <field name="display_name" string="Email"
  80. filter_domain="['|', ('sender', 'ilike', self), ('recipient', 'ilike', self)]"/>
  81. <field name="sender" string="Sender"/>
  82. <field name="recipient" string="Sender"/>
  83. <field name="name" string="Subject"/>
  84. <field name="time" string="Time"/>
  85. <field name="date" string="Date"/>
  86. <filter name="sent" string="Sent" domain="[('state', 'in', ('sent',))]"/>
  87. <filter name="deferred" string="Deferred" domain="[('state', '=', 'deferred')]"/>
  88. <filter name="delivered" string="Delivered" domain="[('state', 'in', ('delivered', 'opened'))]"/>
  89. <filter name="unsub" string="Unsubscribed" domain="[('state', '=', 'unsub')]"/>
  90. <filter name="exception" string="Failed"
  91. domain="[('state', 'in', ('error', 'rejected', 'spam', 'bounced', 'soft-bounced'))]"/>
  92. <separator/>
  93. <group expand="0" string="Group By">
  94. <filter string="State" domain="[]" context="{'group_by': 'state'}"/>
  95. <filter string="Subject" domain="[]" context="{'group_by': 'name'}"/>
  96. <filter string="Sender" domain="[]" context="{'group_by': 'sender'}"/>
  97. <filter string="Month" domain="[]" context="{'group_by': 'date'}"/>
  98. </group>
  99. </search>
  100. </field>
  101. </record>
  102. <record id="action_view_mail_tracking_email" model="ir.actions.act_window">
  103. <field name="name">MailTracking emails</field>
  104. <field name="res_model">mail.tracking.email</field>
  105. <field name="view_type">form</field>
  106. <field name="view_mode">tree,form</field>
  107. <field name="search_view_id" ref="view_mail_tracking_email_search"/>
  108. </record>
  109. <!-- Add menu entry in Settings/Email -->
  110. <menuitem name="Tracking emails" id="menu_mail_tracking_email"
  111. parent="base.menu_email"
  112. action="action_view_mail_tracking_email"/>
  113. </odoo>