mail_compose_message_views.xml 6.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <data>
  4. <record model="ir.ui.view" id="email_compose_message_wizard_form">
  5. <field name="name">mail.compose.message.form</field>
  6. <field name="model">mail.compose.message</field>
  7. <field name="groups_id" eval="[Command.link(ref('base.group_user'))]"/>
  8. <field name="arch" type="xml">
  9. <form string="Compose Email" class="pt-0 pb-0 o_mail_composer_form">
  10. <group>
  11. <!-- truly invisible fields for control and options -->
  12. <field name="author_id" invisible="1"/>
  13. <field name="auto_delete" invisible="1"/>
  14. <field name="auto_delete_message" invisible="1"/>
  15. <field name="composition_mode" invisible="1"/>
  16. <field name="email_layout_xmlid" invisible="1"/>
  17. <field name="is_log" invisible="1"/>
  18. <field name="mail_server_id" invisible="1"/>
  19. <field name="model" invisible="1"/>
  20. <field name="parent_id" invisible="1"/>
  21. <field name="record_name" invisible="1"/>
  22. <field name="res_id" invisible="1"/>
  23. <field name="subtype_id" invisible="1"/>
  24. <!-- visible wizard -->
  25. <field name="email_from"
  26. attrs="{'invisible':[('composition_mode', '!=', 'mass_mail')]}"/>
  27. <label for="partner_ids" string="Recipients" attrs="{'invisible': ['|', ('is_log', '=', True), ('composition_mode', '!=', 'comment')]}"/>
  28. <div groups="base.group_user" attrs="{'invisible': ['|', ('is_log', '=', True), ('composition_mode', '!=', 'comment')]}">
  29. <span name="document_followers_text" attrs="{'invisible':['|', ('model', '=', False), ('composition_mode', '=', 'mass_mail')]}">Followers of the document and</span>
  30. <field name="partner_ids" widget="many2many_tags_email" placeholder="Add contacts to notify..."
  31. context="{'force_email':True, 'show_email':True}"/>
  32. </div>
  33. <field name="subject" placeholder="Welcome to MyCompany!" required="True"/>
  34. <!-- mass post -->
  35. <field name="notify"
  36. attrs="{'invisible':[('composition_mode', '!=', 'mass_post')]}"/>
  37. </group>
  38. <field name="can_edit_body" invisible="1"/>
  39. <div attrs="{'invisible': [('composition_mode', '=', 'mass_mail')]}">
  40. <field name="body" class="oe-bordered-editor" placeholder="Write your message here..." options="{'style-inline': true}" attrs="{'readonly': [('can_edit_body', '=', False)]}" force_save="1"/>
  41. <group col="4">
  42. <field name="attachment_ids" widget="many2many_binary" string="Attach a file" nolabel="1" colspan="2"/>
  43. <field name="template_id" string="Load template" options="{'no_create': True}"
  44. context="{'default_model': model, 'default_body_html': body, 'default_subject': subject}"/>
  45. </group>
  46. </div>
  47. <notebook attrs="{'invisible': [('composition_mode', '!=', 'mass_mail')]}">
  48. <page string="Content">
  49. <div>
  50. <field name="body" class="oe-bordered-editor" placeholder="Write your message here..." options="{'style-inline': true}" attrs="{'readonly': [('can_edit_body', '=', False)]}" force_save="1"/>
  51. <group col="4">
  52. <field name="attachment_ids" widget="many2many_binary" string="Attach a file" nolabel="1" colspan="2"/>
  53. <field name="template_id" string="Load template" options="{'no_create': True}"
  54. context="{'default_model': model, 'default_body_html': body, 'default_subject': subject}"/>
  55. </group>
  56. </div>
  57. </page>
  58. <page string="Settings">
  59. <!-- mass mailing -->
  60. <field name="reply_to_force_new" invisible="1"/>
  61. <field name="reply_to_mode" attrs="{'invisible':[('composition_mode', '!=', 'mass_mail')]}" widget="radio"/>
  62. <group>
  63. <field name="reply_to" string="Reply-to Address" placeholder='e.g: "info@mycompany.odoo.com"'
  64. attrs="{'invisible':['|', ('reply_to_mode', '=', 'update'), ('composition_mode', '!=', 'mass_mail')],
  65. 'required':[('reply_to_mode', '!=', 'update'), ('composition_mode', '=', 'mass_mail')]}"/>
  66. </group>
  67. </page>
  68. </notebook>
  69. <footer>
  70. <button string="Send" attrs="{'invisible': [('is_log', '=', True)]}" name="action_send_mail" type="object" class="btn-primary o_mail_send" data-hotkey="q"/>
  71. <button string="Log" attrs="{'invisible': [('is_log', '=', False)]}" name="action_send_mail" type="object" class="btn-primary" data-hotkey="q"/>
  72. <button string="Cancel" class="btn-secondary" special="cancel" data-hotkey="z" />
  73. <button icon="fa-lg fa-save" type="object"
  74. name="action_save_as_template" string="Save as new template"
  75. attrs="{'invisible': [('can_edit_body', '=', False)]}"
  76. class="float-end btn-secondary" help="Save as a new template" data-hotkey="w"/>
  77. </footer>
  78. </form>
  79. </field>
  80. </record>
  81. <record id="action_email_compose_message_wizard" model="ir.actions.act_window">
  82. <field name="name">Compose Email</field>
  83. <field name="res_model">mail.compose.message</field>
  84. <field name="binding_model_id" ref="mail.model_mail_compose_message"/>
  85. <field name="type">ir.actions.act_window</field>
  86. <field name="view_mode">form</field>
  87. <field name="target">new</field>
  88. </record>
  89. </data>
  90. </odoo>