mail_group_message_views.xml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <record id="mail_group_message_view_list" model="ir.ui.view">
  4. <field name="name">mail.group.message.view.list</field>
  5. <field name="model">mail.group.message</field>
  6. <field name="arch" type="xml">
  7. <tree sample="1">
  8. <field name="create_date"/>
  9. <field name="author_id"/>
  10. <field name="email_from"/>
  11. <field name="subject"/>
  12. <field name="mail_group_id"/>
  13. <field name="moderation_status"/>
  14. <field name="is_group_moderated" invisible="1"/>
  15. <button name="action_moderate_accept" string="Accept" title="Accept"
  16. type="object" class="btn btn-primary"
  17. attrs="{'invisible': ['|', ('moderation_status', '!=', 'pending_moderation'), ('is_group_moderated', '=', False)]}"/>
  18. <button name="%(mail_group_message_reject_action)d"
  19. string="Reject" title="Remove message with explanation"
  20. type="action" class="btn btn-secondary"
  21. attrs="{'invisible': ['|', ('moderation_status', '!=', 'pending_moderation'), ('is_group_moderated', '=', False)]}"
  22. context="{'default_mail_group_message_id': id, 'default_action': 'reject'}" />
  23. <button name="action_moderate_allow" string="Whitelist"
  24. title="Add this email address to white list of people and accept all pending messages from the same author."
  25. type="object" class="btn btn-secondary"
  26. attrs="{'invisible': ['|', ('moderation_status', '!=', 'pending_moderation'), ('is_group_moderated', '=', False)]}"/>
  27. <button name="%(mail_group_message_reject_action)d"
  28. string="Ban" title="Ban this email address and reject all pending messages from the same author and send an email to the author"
  29. type="action" class="btn btn-secondary"
  30. attrs="{'invisible': ['|', ('moderation_status', '!=', 'pending_moderation'), ('is_group_moderated', '=', False)]}"
  31. context="{'default_mail_group_message_id': id, 'default_action': 'ban'}" />
  32. <button name="action_moderate_accept" string="Send" title="Send"
  33. type="object" class="btn btn-primary"
  34. attrs="{'invisible': ['|', ('moderation_status', '!=', 'pending_moderation'), ('is_group_moderated', '=', True)]}"/>
  35. </tree>
  36. </field>
  37. </record>
  38. <record id="mail_group_message_view_form" model="ir.ui.view">
  39. <field name="name">mail.group.message.view.form</field>
  40. <field name="model">mail.group.message</field>
  41. <field name="arch" type="xml">
  42. <form string="Group Message" class="o_mail_group_message_form">
  43. <header>
  44. <button name="action_moderate_accept" string="Accept" title="Accept"
  45. type="object" class="btn btn-primary"
  46. attrs="{'invisible': ['|', ('moderation_status', '!=', 'pending_moderation'), ('is_group_moderated', '=', False)]}"/>
  47. <button name="%(mail_group_message_reject_action)d"
  48. string="Reject" title="Remove message with explanation"
  49. type="action" class="btn btn-secondary"
  50. attrs="{'invisible': ['|', ('moderation_status', '!=', 'pending_moderation'), ('is_group_moderated', '=', False)]}"
  51. context="{'default_mail_group_message_id': id, 'default_action': 'reject'}" />
  52. <button name="action_moderate_allow" string="Whitelist"
  53. title="Add this email address to white list of people and accept all pending messages from the same author."
  54. type="object" class="btn btn-secondary"
  55. attrs="{'invisible': [('is_group_moderated', '=', False)]}"/>
  56. <button name="%(mail_group_message_reject_action)d"
  57. string="Ban" title="Ban this email address and reject all pending messages from the same author and send an email to the author"
  58. type="action" class="btn btn-secondary"
  59. attrs="{'invisible': ['|', ('moderation_status', '!=', 'pending_moderation'), ('is_group_moderated', '=', False)]}"
  60. context="{'default_mail_group_message_id': id, 'default_action': 'ban'}" />
  61. <button name="action_moderate_accept" string="Send" title="Send"
  62. type="object" class="btn btn-primary"
  63. attrs="{'invisible': ['|', ('moderation_status', '!=', 'pending_moderation'), ('is_group_moderated', '=', True)]}"/>
  64. </header>
  65. <sheet>
  66. <widget name="web_ribbon" title="Rejected" bg_color="bg-danger"
  67. attrs="{'invisible': [('moderation_status', '!=', 'rejected')]}"/>
  68. <widget name="web_ribbon" title="Accepted" bg_color="bg-success"
  69. attrs="{'invisible': [('moderation_status', '!=', 'accepted')]}"/>
  70. <group>
  71. <field name="mail_message_id" invisible="1"/>
  72. <field name="moderation_status" invisible="1"/>
  73. <field name="is_group_moderated" invisible="1"/>
  74. <field name="subject"/>
  75. <field name="author_id"/>
  76. <label for="email_from" string="From"/>
  77. <div>
  78. <field name="email_from" nolabel="1"/>
  79. <span class="ms-2 badge text-bg-success" attrs="{'invisible': [('author_moderation', '!=', 'allow')]}">Whitelisted</span>
  80. <span class="ms-2 badge text-bg-danger" attrs="{'invisible': [('author_moderation', '!=', 'ban')]}">Banned</span>
  81. <field name="author_moderation" invisible="1"/>
  82. </div>
  83. <field name="mail_group_id"/>
  84. <field name="create_date"/>
  85. <field name="attachment_ids" widget="many2many_binary"/>
  86. <field name="body" options="{'style-inline': true}"/>
  87. </group>
  88. </sheet>
  89. </form>
  90. </field>
  91. </record>
  92. <record id="mail_group_message_view_search" model="ir.ui.view">
  93. <field name="name">mail.group.message.view.search</field>
  94. <field name="model">mail.group.message</field>
  95. <field name="arch" type="xml">
  96. <search string="Search Group Message">
  97. <field name="mail_group_id"/>
  98. <field name="email_from"/>
  99. <field name="author_id"/>
  100. <field name="moderation_status"/>
  101. <separator/>
  102. <group expand="0" string="Group By">
  103. <filter string="group" name="group_by_group" context="{'group_by': 'mail_group_id'}"/>
  104. </group>
  105. </search>
  106. </field>
  107. </record>
  108. <record id="mail_group_message_action" model="ir.actions.act_window">
  109. <field name="name">Messages</field>
  110. <field name="res_model">mail.group.message</field>
  111. <field name="view_mode">tree,form</field>
  112. <field name="help" type="html">
  113. <p class="o_view_nocontent_smiling_face">No Messages in this list yet!</p>
  114. <p>When people send an email to the alias of the list, they will appear here.</p>
  115. </field>
  116. </record>
  117. </odoo>