email_template.xml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?xml version="1.0"?>
  2. <openerp>
  3. <data>
  4. <!-- Email Templates -->
  5. <record model="ir.ui.view" id="email_template_form_minimal">
  6. <field name="name">email.template.form.minimal</field>
  7. <field name="model">email.template</field>
  8. <field name="priority">32</field>
  9. <field name="arch" type="xml">
  10. <form string="Templates">
  11. <sheet>
  12. <group>
  13. <group>
  14. <field name="name" required="True"/>
  15. <field name="model_id" required="1" options="{'no_open': True, 'no_create': True}"
  16. on_change="onchange_model_id(model_id)"
  17. domain="[('model', 'in', ['res.partner', 'mail.mass_mailing.contact', 'crm.lead', 'hr.applicant'])]"/>
  18. <field name="model" invisible="True"/>
  19. <field name="use_default_to" invisible="1"/>
  20. </group>
  21. <group>
  22. <div class="oe_right oe_button_box" name="buttons">
  23. <button string="Edit Template" name="action_edit_html" type="object"/>
  24. <button name="%(email_template.wizard_email_template_preview)d" string="Preview"
  25. type="action" target="new"
  26. context="{'template_id':active_id}"/>
  27. <br />
  28. </div>
  29. </group>
  30. </group>
  31. <notebook>
  32. <page string="Body">
  33. <field name="body_html" nolabel="1"/>
  34. <field name="attachment_ids" widget="many2many_binary"/>
  35. </page>
  36. </notebook>
  37. </sheet>
  38. </form>
  39. </field>
  40. </record>
  41. <record model="ir.ui.view" id="view_email_template_kanban">
  42. <field name="name">email.template.kanban</field>
  43. <field name="model">email.template</field>
  44. <field name="arch" type="xml">
  45. <kanban>
  46. <field name="body_html"/>
  47. <templates>
  48. <t t-name="kanban-box">
  49. <div t-attf-class="oe_kanban_card oe_kanban_global_click oe_kanban_email_template">
  50. <div class="oe_dropdown_toggle oe_dropdown_kanban">
  51. <span class="oe_e">i</span>
  52. <ul class="oe_dropdown_menu" t-if="widget.view.is_action_enabled('edit') or widget.view.is_action_enabled('delete')">
  53. <t t-if="widget.view.is_action_enabled('edit')">
  54. <li><a type="edit">Edit</a></li>
  55. </t>
  56. <t t-if="widget.view.is_action_enabled('delete')">
  57. <li><a type="delete">Delete</a></li>
  58. </t>
  59. </ul>
  60. </div>
  61. <div class="oe_kanban_content">
  62. <h3>
  63. <field name="name"/>
  64. </h3>
  65. <div class="kanban_html_preview">
  66. <t t-raw="record.body_html.raw_value"/>
  67. </div>
  68. </div>
  69. <div class="oe_clear"></div>
  70. </div>
  71. </t>
  72. </templates>
  73. </kanban>
  74. </field>
  75. </record>
  76. <record model="ir.actions.act_window" id="action_email_template_marketing">
  77. <field name="name">Templates</field>
  78. <field name="res_model">email.template</field>
  79. <field name="view_type">form</field>
  80. <field name="view_mode">kanban,tree,form</field>
  81. <field name="context">{
  82. 'form_view_ref': 'mass_mailing.email_template_form_minimal',
  83. 'default_use_default_to': True,
  84. }</field>
  85. </record>
  86. <!-- Add Templates in Marketing / Mass mailing menu -->
  87. <menuitem name="Mail Templates" id="menu_email_template"
  88. parent="mass_mailing_campaign" sequence="3"
  89. action="action_email_template_marketing"/>
  90. </data>
  91. </openerp>