You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123 lines
4.7 KiB

[9.0][MIG][mass_mailing_custom_unsubscribe] Migrate. - Imported last updates from v8. - Adapted to v9. - Added a saner default to `mass_mailing.salt` configuration parameter by reusing `database.secret` if available, hoping that some day https://github.com/odoo/odoo/pull/12040 gets merged. - Updated README. - Increase security, drop backwards compatibility. Security got improved upstream, which would again break compatibility among current addon and future master upstream. I choose to break it now and keep it secured future-wise, so I drop the backwards compatibility features. - Includes tour tests. - Removes outdated tests. - Extends the mailing list management form when unsubscriber is a contact. - Adds a reason form even if he is not. - Avoids all methods that were not model-agnostic. [FIX][mass_mailing_custom_unsubscribe] Reasons noupdate After this fix, when you update the addon, you will not lose your customized reasons. [FIX] Compatibilize with mass_mailing_partner Current test code was based on the assumption that the `@api.model` decorator on `create()` ensured an empty recordset when running the method, but that's not true. This was causing an incompatibility betwee these tests and the `mass_mailing_partner` addon, which works assuming 0-1 recordsets. Now records are created from an empty recordset, and thus tests work everywhere. Update instructions If the user does not add the unsubscribe snippet, nothing will happen, so it's added to README to avoid confusion when testing/using the addon. [FIX] Use the right operator to preserve recordsets order Using `|=` sorts records at will each time (treating them as Python's `set`). Using `+=` always appends a record to the end of the set. Since we are using the record position in the set, this caused the test to work sometimes and fail other times. Now it works always.
8 years ago
[9.0][MIG][mass_mailing_custom_unsubscribe] Migrate. - Imported last updates from v8. - Adapted to v9. - Added a saner default to `mass_mailing.salt` configuration parameter by reusing `database.secret` if available, hoping that some day https://github.com/odoo/odoo/pull/12040 gets merged. - Updated README. - Increase security, drop backwards compatibility. Security got improved upstream, which would again break compatibility among current addon and future master upstream. I choose to break it now and keep it secured future-wise, so I drop the backwards compatibility features. - Includes tour tests. - Removes outdated tests. - Extends the mailing list management form when unsubscriber is a contact. - Adds a reason form even if he is not. - Avoids all methods that were not model-agnostic. [FIX][mass_mailing_custom_unsubscribe] Reasons noupdate After this fix, when you update the addon, you will not lose your customized reasons. [FIX] Compatibilize with mass_mailing_partner Current test code was based on the assumption that the `@api.model` decorator on `create()` ensured an empty recordset when running the method, but that's not true. This was causing an incompatibility betwee these tests and the `mass_mailing_partner` addon, which works assuming 0-1 recordsets. Now records are created from an empty recordset, and thus tests work everywhere. Update instructions If the user does not add the unsubscribe snippet, nothing will happen, so it's added to README to avoid confusion when testing/using the addon. [FIX] Use the right operator to preserve recordsets order Using `|=` sorts records at will each time (treating them as Python's `set`). Using `+=` always appends a record to the end of the set. Since we are using the record position in the set, this caused the test to work sometimes and fail other times. Now it works always.
8 years ago
[9.0][MIG][mass_mailing_custom_unsubscribe] Migrate. - Imported last updates from v8. - Adapted to v9. - Added a saner default to `mass_mailing.salt` configuration parameter by reusing `database.secret` if available, hoping that some day https://github.com/odoo/odoo/pull/12040 gets merged. - Updated README. - Increase security, drop backwards compatibility. Security got improved upstream, which would again break compatibility among current addon and future master upstream. I choose to break it now and keep it secured future-wise, so I drop the backwards compatibility features. - Includes tour tests. - Removes outdated tests. - Extends the mailing list management form when unsubscriber is a contact. - Adds a reason form even if he is not. - Avoids all methods that were not model-agnostic. [FIX][mass_mailing_custom_unsubscribe] Reasons noupdate After this fix, when you update the addon, you will not lose your customized reasons. [FIX] Compatibilize with mass_mailing_partner Current test code was based on the assumption that the `@api.model` decorator on `create()` ensured an empty recordset when running the method, but that's not true. This was causing an incompatibility betwee these tests and the `mass_mailing_partner` addon, which works assuming 0-1 recordsets. Now records are created from an empty recordset, and thus tests work everywhere. Update instructions If the user does not add the unsubscribe snippet, nothing will happen, so it's added to README to avoid confusion when testing/using the addon. [FIX] Use the right operator to preserve recordsets order Using `|=` sorts records at will each time (treating them as Python's `set`). Using `+=` always appends a record to the end of the set. Since we are using the record position in the set, this caused the test to work sometimes and fail other times. Now it works always.
8 years ago
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- Copyright 2016 Jairo Llopis <jairo.llopis@tecnativa.com>
  3. License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
  4. <odoo>
  5. <record id="mail_unsubscription_view_form" model="ir.ui.view">
  6. <field name="name">Mail Unsubscription Form</field>
  7. <field name="model">mail.unsubscription</field>
  8. <field name="arch" type="xml">
  9. <form>
  10. <sheet>
  11. <group>
  12. <field name="date"/>
  13. <field name="mass_mailing_id"/>
  14. <field name="unsubscriber_id"/>
  15. <field name="mailing_list_ids" widget="many2many_tags"/>
  16. <field name="email"/>
  17. <field name="action"/>
  18. <field name="reason_id"
  19. attrs="{'required': [('action', '=', 'unsubscription')]}"/>
  20. <field name="details"
  21. attrs="{'required': [('details_required', '=', True)]}"/>
  22. <field name="details_required" invisible="True"/>
  23. <field name="metadata"/>
  24. </group>
  25. </sheet>
  26. <div class="oe_chatter">
  27. <field name="message_follower_ids"
  28. widget="mail_followers"
  29. groups="base.group_user"/>
  30. <field name="message_ids"
  31. widget="mail_thread"/>
  32. </div>
  33. </form>
  34. </field>
  35. </record>
  36. <record id="mail_unsubscription_view_tree" model="ir.ui.view">
  37. <field name="name">Mail Unsubscription Tree</field>
  38. <field name="model">mail.unsubscription</field>
  39. <field name="arch" type="xml">
  40. <tree decoration-warning="action in ['unsubscription', 'blacklisting']">
  41. <field name="date"/>
  42. <field name="mass_mailing_id"/>
  43. <field name="unsubscriber_id"/>
  44. <field name="mailing_list_ids" widget="many2many_tags"/>
  45. <field name="email" invisible="True"/>
  46. <field name="action"/>
  47. <field name="reason_id"/>
  48. <field name="details" invisible="True"/>
  49. </tree>
  50. </field>
  51. </record>
  52. <record id="mail_unsubscription_view_search" model="ir.ui.view">
  53. <field name="name">Mail Unsubscription Search</field>
  54. <field name="model">mail.unsubscription</field>
  55. <field name="arch" type="xml">
  56. <search>
  57. <field name="mass_mailing_id"/>
  58. <field name="unsubscriber_id"/>
  59. <field name="mailing_list_ids"/>
  60. <field name="email"/>
  61. <field name="reason_id"/>
  62. <field name="details"/>
  63. <separator/>
  64. <group string="Group by">
  65. <filter name="group_by_month"
  66. string="Month"
  67. context="{'group_by': 'date:month'}"/>
  68. <filter name="group_by_year"
  69. string="Year"
  70. context="{'group_by': 'date:year'}"/>
  71. <filter name="group_by_action"
  72. string="Action"
  73. context="{'group_by': 'action'}"/>
  74. <filter name="group_by_email"
  75. string="Email"
  76. context="{'group_by': 'email'}"/>
  77. <filter name="group_by_reason"
  78. string="Reason"
  79. context="{'group_by': 'reason_id'}"/>
  80. <filter name="group_by_mass_mailing"
  81. string="Mass mailing"
  82. context="{'group_by': 'mass_mailing_id'}"/>
  83. </group>
  84. </search>
  85. </field>
  86. </record>
  87. <record model="ir.ui.view" id="mail_unsubscription_view_pivot">
  88. <field name="name">Mail Unsubscription Pivot</field>
  89. <field name="model">mail.unsubscription</field>
  90. <field name="arch" type="xml">
  91. <pivot string="(Un)subscriptions">
  92. <field name="reason_id" type="row"/>
  93. <field name="mailing_list_ids" type="row"/>
  94. <field name="action" type="col"/>
  95. </pivot>
  96. </field>
  97. </record>
  98. <record model="ir.ui.view" id="mail_unsubscription_view_graph">
  99. <field name="name">Mail Unsubscription Graph</field>
  100. <field name="model">mail.unsubscription</field>
  101. <field name="arch" type="xml">
  102. <graph string="(Un)subscriptions">
  103. <field name="date" type="row"/>
  104. <field name="action" type="col"/>
  105. </graph>
  106. </field>
  107. </record>
  108. <act_window id="mail_unsubscription_action"
  109. name="(Un)subscriptions"
  110. view_mode="tree,form,pivot,graph"
  111. res_model="mail.unsubscription"/>
  112. <menuitem id="mail_unsubscription_menu" parent="mass_mailing.mass_mailing_menu_root"
  113. action="mail_unsubscription_action"/>
  114. </odoo>