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.

118 lines
4.4 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
[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_id"/>
  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 == 'unsubscription'">
  41. <field name="date"/>
  42. <field name="mass_mailing_id"/>
  43. <field name="unsubscriber_id"/>
  44. <field name="mailing_list_id"/>
  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_id"/>
  60. <field name="email"/>
  61. <field name="reason_id"/>
  62. <field name="details"/>
  63. <separator/>
  64. <group string="Group by">
  65. <filter string="Month"
  66. context="{'group_by': 'date:month'}"/>
  67. <filter string="Year"
  68. context="{'group_by': 'date:year'}"/>
  69. <filter string="Action"
  70. context="{'group_by': 'action'}"/>
  71. <filter string="Email"
  72. context="{'group_by': 'email'}"/>
  73. <filter string="Reason"
  74. context="{'group_by': 'reason_id'}"/>
  75. <filter string="Mass mailing"
  76. context="{'group_by': 'mass_mailing_id'}"/>
  77. </group>
  78. </search>
  79. </field>
  80. </record>
  81. <record model="ir.ui.view" id="mail_unsubscription_view_pivot">
  82. <field name="name">Mail Unsubscription Pivot</field>
  83. <field name="model">mail.unsubscription</field>
  84. <field name="arch" type="xml">
  85. <pivot string="(Un)subscriptions">
  86. <field name="reason_id" type="row"/>
  87. <field name="mailing_list_id" type="row"/>
  88. <field name="action" type="col"/>
  89. </pivot>
  90. </field>
  91. </record>
  92. <record model="ir.ui.view" id="mail_unsubscription_view_graph">
  93. <field name="name">Mail Unsubscription Graph</field>
  94. <field name="model">mail.unsubscription</field>
  95. <field name="arch" type="xml">
  96. <graph string="(Un)subscriptions">
  97. <field name="date" type="row"/>
  98. <field name="action" type="col"/>
  99. </graph>
  100. </field>
  101. </record>
  102. <act_window id="mail_unsubscription_action"
  103. name="(Un)subscriptions"
  104. view_mode="tree,form,pivot,graph"
  105. res_model="mail.unsubscription"/>
  106. <menuitem id="mail_unsubscription_menu"
  107. parent="mass_mailing.mass_mailing_menu"
  108. action="mail_unsubscription_action"/>
  109. </odoo>