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.

77 lines
3.6 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <!-- Extension of mail.mail form view -->
  4. <record model="ir.ui.view" id="email_form_view">
  5. <field name="name">mail.mail.sendgrid</field>
  6. <field name="model">mail.mail</field>
  7. <field name="inherit_id" ref="mail.view_mail_form"/>
  8. <field name="arch" type="xml">
  9. <button name="send" position="replace">
  10. <field name="send_method" invisible="1"/>
  11. <button name="send" string="Send Now" type="object" class="oe_highlight" attrs="{'invisible': ['|', ('send_method', 'not in', ['sendgrid','traditional']), ('state', '!=', 'outgoing')]}"/>
  12. <button name="send_sendgrid" string="Send (SendGrid)" type="object" class="oe_highlight" attrs="{'invisible': ['|', ('send_method', '=', 'sendgrid'), ('state', '!=', 'outgoing')]}"/>
  13. </button>
  14. <field name="body_html" position="attributes">
  15. <attribute name="widget">html</attribute>
  16. </field>
  17. <xpath expr="//field[@name='attachment_ids']/ancestor::page" position="after">
  18. <page string="SendGrid">
  19. <group>
  20. <field name="sendgrid_template_id"/>
  21. <field name="sent_date" readonly="1"/>
  22. <field name="opened" readonly="1"/>
  23. <field name="click_count" readonly="1"/>
  24. <field name="body_text"/>
  25. </group>
  26. <field name="substitution_ids" widget="one2many_list"/>
  27. <field name="tracking_event_ids">
  28. <tree default_order="time desc">
  29. <field name="tracking_email_id"/>
  30. <field name="time"/>
  31. <field name="event_type"/>
  32. <field name="url"/>
  33. </tree>
  34. </field>
  35. </page>
  36. </xpath>
  37. </field>
  38. </record>
  39. <!-- Extension of mail.mail tree view -->
  40. <record model="ir.ui.view" id="sendgrid_email_tree_view">
  41. <field name="name">mail.mail.sendgrid.tree</field>
  42. <field name="model">mail.mail</field>
  43. <field name="inherit_id" ref="mail.view_mail_tree"/>
  44. <field name="arch" type="xml">
  45. <field name="date" position="after">
  46. <field name="opened"/>
  47. <field name="click_count"/>
  48. </field>
  49. </field>
  50. </record>
  51. <!-- Extension of mail.mail search view -->
  52. <record model="ir.ui.view" id="sendgrid_email_search_view">
  53. <field name="name">mail.mail.sendgrid.search</field>
  54. <field name="model">mail.mail</field>
  55. <field name="inherit_id" ref="mail.view_mail_search"/>
  56. <field name="arch" type="xml">
  57. <xpath expr="//filter[@name='received']" position="after">
  58. <filter name="opened" string="Opened" domain="[('opened','=',True)]"/>
  59. <filter name="clicked" string="Clicked" domain="[('click_count','>',0)]"/>
  60. </xpath>
  61. </field>
  62. </record>
  63. <!-- Substitution line view -->
  64. <record id="view_sendgrid_substitution_line_tree" model="ir.ui.view">
  65. <field name="name">sendgrid.substitution.tree</field>
  66. <field name="model">sendgrid.substitution</field>
  67. <field name="arch" type="xml">
  68. <tree string="Template substitutions" editable="bottom">
  69. <field name="key"/>
  70. <field name="value"/>
  71. </tree>
  72. </field>
  73. </record>
  74. </odoo>