mail_compose_message_views.xml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <!-- Add mass mail campaign to the mail.compose.message form view -->
  4. <record model="ir.ui.view" id="email_compose_form_mass_mailing">
  5. <field name="name">mail.compose.message.form.mass_mailing</field>
  6. <field name="model">mail.compose.message</field>
  7. <field name="inherit_id" ref="mail.email_compose_message_wizard_form"/>
  8. <field name="arch" type="xml">
  9. <xpath expr="//field[@name='notify']" position="after">
  10. <field name="campaign_id" groups="mass_mailing.group_mass_mailing_campaign"
  11. attrs="{'invisible': [('composition_mode', '!=', 'mass_mail')]}"/>
  12. <field name="mass_mailing_name"
  13. attrs="{'invisible': [('composition_mode', '!=', 'mass_mail')]}"/>
  14. </xpath>
  15. <xpath expr="//button[@name='action_send_mail'][not(hasclass('o_mail_send'))]" position="attributes">
  16. <!-- 'Log' button -->
  17. <attribute name="attrs">
  18. {'invisible': [
  19. '|',
  20. ('is_log', '=', False),
  21. '&amp;',
  22. ('mass_mailing_name', '!=', ''),
  23. ('mass_mailing_name', '!=', False)
  24. ]}
  25. </attribute>
  26. </xpath>
  27. <xpath expr="//button[hasclass('o_mail_send')]" position="attributes">
  28. <!-- 'Send' button -->
  29. <attribute name="attrs">
  30. {'invisible': [
  31. '|',
  32. ('is_log', '=', True),
  33. '&amp;',
  34. ('mass_mailing_name', '!=', ''),
  35. ('mass_mailing_name', '!=', False)
  36. ]}
  37. </attribute>
  38. </xpath>
  39. <xpath expr="//button[@name='action_send_mail']" position="after">
  40. <button string="Send Mass Mailing" name="action_send_mail" type="object" class="btn-primary o_mail_send"
  41. attrs="{'invisible': ['|', ('mass_mailing_name', '==', ''), ('mass_mailing_name', '==', False)]}" data-hotkey="q"/>
  42. </xpath>
  43. </field>
  44. </record>
  45. </odoo>