mail_template_views.xml 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <odoo>
  3. <data>
  4. <record model="ir.ui.view" id="email_template_form">
  5. <field name="name">email.template.form</field>
  6. <field name="model">mail.template</field>
  7. <field name="arch" type="xml">
  8. <form string="Templates">
  9. <header>
  10. <field name="template_fs" invisible="1"/>
  11. <button string="Reset Template"
  12. name="%(mail_template_reset_action)d" type="action"
  13. groups="mail.group_mail_template_editor"
  14. attrs="{'invisible': [('template_fs', '=', False)]}"/>
  15. </header>
  16. <sheet>
  17. <div class="oe_button_box" name="button_box">
  18. <field name="ref_ir_act_window" invisible="1"/>
  19. <button class="oe_stat_button"
  20. groups="base.group_no_one"
  21. name="create_action" type="object"
  22. attrs="{'invisible':[('ref_ir_act_window','!=',False)]}" icon="fa-plus"
  23. help="Display an option on related documents to open a composition wizard with this template">
  24. <div class="o_field_widget o_stat_info">
  25. <span class="o_stat_text">Add</span>
  26. <span class="o_stat_text">Context Action</span>
  27. </div>
  28. </button>
  29. <button name="unlink_action" type="object"
  30. groups="base.group_no_one"
  31. class="oe_stat_button" icon="fa-minus"
  32. attrs="{'invisible':[('ref_ir_act_window','=',False)]}"
  33. help="Remove the contextual action to use this template on related documents" widget="statinfo">
  34. <div class="o_field_widget o_stat_info">
  35. <span class="o_stat_text">Remove</span>
  36. <span class="o_stat_text">Context Action</span>
  37. </div>
  38. </button>
  39. <button class="oe_stat_button" name="%(mail_template_preview_action)d" icon="fa-search-plus" string="Preview"
  40. type="action" target="new"/>
  41. </div>
  42. <div class="oe_title">
  43. <label for="name"/>
  44. <h1><field name="name" class="w-100"
  45. required="1" placeholder='e.g. "Welcome email"'/></h1>
  46. <group>
  47. <field name="model_id" placeholder="e.g. Contact" required="1" options="{'no_create': True}"/>
  48. <field name="subject" placeholder='e.g. "Welcome to MyCompany" or "Nice to meet you, {{ object.name }}"'/>
  49. <field name="model" invisible="1"/>
  50. <field name="description"/>
  51. </group>
  52. </div>
  53. <notebook>
  54. <page string="Content" name="content">
  55. <field name="can_write" invisible="1"/>
  56. <field name="body_html" widget="html" class="oe-bordered-editor"
  57. options="{'style-inline': true, 'codeview': true, 'dynamic_placeholder': true}"
  58. attrs="{'readonly': [('can_write', '=', False), ('id', '!=', False)]}"/>
  59. <field name="attachment_ids" widget="many2many_binary"/>
  60. </page>
  61. <page string="Email Configuration" name="email_configuration">
  62. <group>
  63. <field name="email_from"
  64. placeholder="Override author's email"/>
  65. <field name="use_default_to"/>
  66. <field name="email_to" attrs="{'invisible': [('use_default_to', '=', True)]}"
  67. placeholder="Comma-separated recipient addresses"/>
  68. <field name="partner_to" attrs="{'invisible': [('use_default_to', '=', True)]}"
  69. placeholder="Comma-separated ids of recipient partners"/>
  70. <field name="email_cc" attrs="{'invisible': [('use_default_to', '=', True)]}"
  71. placeholder="Comma-separated carbon copy recipients addresses"/>
  72. <field name="reply_to"
  73. placeholder="Email address to which replies will be redirected when sending emails in mass"/>
  74. <field name="scheduled_date" string="Scheduled Send Date"/>
  75. </group>
  76. </page>
  77. <page string="Settings" name="email_settings">
  78. <group>
  79. <field name="lang" placeholder="{{ object.partner_id.lang }}"/>
  80. <field name="mail_server_id"/>
  81. <field name="auto_delete"/>
  82. <field name="report_template" domain="[('model','=',model)]"/>
  83. <field name="report_name" attrs="{'invisible':[('report_template','=',False)]}"/>
  84. </group>
  85. </page>
  86. </notebook>
  87. </sheet>
  88. </form>
  89. </field>
  90. </record>
  91. <record model="ir.ui.view" id="email_template_tree">
  92. <field name="name">email.template.tree</field>
  93. <field name="model">mail.template</field>
  94. <field name="arch" type="xml">
  95. <tree string="Templates">
  96. <field name="mail_server_id" invisible="1"/>
  97. <field name="name"/>
  98. <field name="model_id" groups="base.group_no_one"/>
  99. <field name="description"/>
  100. <field name="subject" optional="hidden"/>
  101. <field name="email_from" optional="hidden"/>
  102. <field name="email_to" optional="hidden"/>
  103. <field name="partner_to" optional="hidden"/>
  104. <field name="report_name" optional="hidden"/>
  105. </tree>
  106. </field>
  107. </record>
  108. <record id="view_email_template_search" model="ir.ui.view">
  109. <field name="name">email.template.search</field>
  110. <field name="model">mail.template</field>
  111. <field name="arch" type="xml">
  112. <search string="Templates">
  113. <field name="name" filter_domain="['|', '|', '|',('name','ilike',self), ('report_name','ilike',self), ('subject','ilike',self), ('email_to','ilike',self)]" string="Templates"/>
  114. <field name="lang"/>
  115. <field name="model_id"/>
  116. <filter name="base_templates" string="Base Templates" domain="[('template_category', '=', 'base_template')]"/>
  117. <filter name="custom_templates" string="Custom Templates" domain="[('template_category', '=', 'custom_template')]"/>
  118. <group expand="0" string="Group by...">
  119. <filter string="SMTP Server" name="smtpserver" domain="[]" context="{'group_by':'mail_server_id'}"/>
  120. <filter string="Model" name="model" domain="[]" context="{'group_by':'model_id'}"/>
  121. </group>
  122. </search>
  123. </field>
  124. </record>
  125. <record model="ir.actions.act_window" id="action_email_template_tree_all">
  126. <field name="name">Email Templates</field>
  127. <field name="res_model">mail.template</field>
  128. <field name="view_mode">form,tree</field>
  129. <field name="view_id" ref="email_template_tree" />
  130. <field name="search_view_id" ref="view_email_template_search"/>
  131. <field name="context">{'search_default_base_templates': 1}</field>
  132. </record>
  133. </data>
  134. </odoo>