utm_campaign_views.xml 5.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <record model="ir.ui.view" id="utm_campaign_view_form">
  4. <field name="name">utm.campaign.view.form</field>
  5. <field name="model">utm.campaign</field>
  6. <field name="inherit_id" ref="utm.utm_campaign_view_form"/>
  7. <field name="arch" type="xml">
  8. <xpath expr="//header" position="inside">
  9. <field name="is_mailing_campaign_activated" invisible="1"/>
  10. <button name="%(action_create_mass_mailings_from_campaign)d"
  11. type="action" class="oe_highlight" attrs="{'invisible': [('is_mailing_campaign_activated', '=', False)]}"
  12. groups="mass_mailing.group_mass_mailing_user" string="Send Mailing"/>
  13. </xpath>
  14. <xpath expr="//div[hasclass('oe_button_box')]" position="inside">
  15. <button name="%(action_view_mass_mailings_from_campaign)d"
  16. type="action" class="oe_stat_button order-9" icon="fa-envelope-o"
  17. attrs="{'invisible': ['|', ('mailing_mail_count', '=', 0), ('is_mailing_campaign_activated', '=', False)]}"
  18. groups="mass_mailing.group_mass_mailing_user">
  19. <field name="mailing_mail_count" widget="statinfo" string="Mailings"/>
  20. </button>
  21. </xpath>
  22. <xpath expr="//notebook" position="inside">
  23. <page string="Mailings" name="mailings"
  24. attrs="{'invisible': ['|', ('mailing_mail_count', '=', 0), ('is_mailing_campaign_activated', '=', False)]}"
  25. groups="mass_mailing.group_mass_mailing_user">
  26. <field name="mailing_mail_ids" nolabel="1">
  27. <tree>
  28. <field name="calendar_date" string="Date"/>
  29. <field name="subject" attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
  30. <field name="mailing_model_id" string="Recipients" optional="hide"/>
  31. <field name="user_id" widget="many2one_avatar_user"/>
  32. <field name="ab_testing_enabled" string="A/B Test"
  33. groups="mass_mailing.group_mass_mailing_campaign"
  34. attrs="{'column_invisible': [('parent.ab_testing_mailings_count', '=', 0)]}"/>
  35. <field name="campaign_id" string="Campaign" groups="mass_mailing.group_mass_mailing_campaign" optional="hide"/>
  36. <field name="received_ratio" string="Delivered (%)" avg="Average of Delivered"/>
  37. <field name="opened_ratio" string="Opened (%)" avg="Average of Opened"/>
  38. <field name="bounced_ratio" string="Bounced (%)" optional="hide" avg="Average of Bounced"/>
  39. <field name="clicks_ratio" string="Clicked (%)" avg="Average of Clicked"/>
  40. <field name="replied_ratio" string="Replied (%)" avg="Average of Replied"/>
  41. <field name="state" decoration-info="state in ('draft', 'in_queue')" decoration-success="state in ('sending', 'done')" widget="badge"/>
  42. <button name="action_duplicate" type="object" string="Duplicate"/>
  43. </tree>
  44. </field>
  45. </page>
  46. </xpath>
  47. <xpath expr="//notebook" position="after">
  48. <field name="ab_testing_mailings_count" invisible="1"/>
  49. <group name="ab_test_group" groups="mass_mailing.group_mass_mailing_campaign" attrs="{'invisible': [('ab_testing_mailings_count', '=', 0)]}">
  50. <group string="A/B Test">
  51. <field name="ab_testing_completed" invisible="1"/>
  52. <field name="ab_testing_winner_selection" attrs="{'readonly': [('ab_testing_completed', '=', True)]}"/>
  53. <field name="ab_testing_schedule_datetime"
  54. attrs="{'invisible': [('ab_testing_winner_selection', '=', 'manual')], 'readonly': [('ab_testing_completed', '=', True)]}"/>
  55. </group>
  56. </group>
  57. </xpath>
  58. </field>
  59. </record>
  60. <record model="ir.ui.view" id="utm_campaign_view_kanban">
  61. <field name="name">utm.campaign.view.kanban</field>
  62. <field name="model">utm.campaign</field>
  63. <field name="inherit_id" ref="utm.utm_campaign_view_kanban"/>
  64. <field name="arch" type="xml">
  65. <xpath expr="//field[@name='user_id']" position="after">
  66. <field name="mailing_mail_ids" groups="mass_mailing.group_mass_mailing_user"/>
  67. <field name="is_mailing_campaign_activated"/>
  68. </xpath>
  69. <xpath expr="//ul[@id='o_utm_actions']">
  70. <a name="%(action_view_mass_mailings_from_campaign)d" type="action"
  71. t-attf-class="oe_mailings #{record.mailing_mail_ids.raw_value.length === 0 ? 'text-muted' : ''}"
  72. t-if="record.is_mailing_campaign_activated.raw_value"
  73. groups="mass_mailing.group_mass_mailing_user">
  74. <t t-out="record.mailing_mail_ids.raw_value.length"/> Mailings
  75. </a>
  76. </xpath>
  77. </field>
  78. </record>
  79. <record id="action_view_utm_campaigns" model="ir.actions.act_window">
  80. <field name="name">Campaigns</field>
  81. <field name="res_model">utm.campaign</field>
  82. <field name="view_mode">kanban,tree,form</field>
  83. <field name="help" type="html">
  84. <p class="o_view_nocontent_smiling_face">
  85. Create a mailing campaign
  86. </p><p>
  87. Campaigns are the perfect tool to track results across multiple mailings.
  88. </p>
  89. </field>
  90. <field name="domain">[('is_auto_campaign', '=', False)]</field>
  91. </record>
  92. </odoo>