Debian Codegraph @

addons/marketing_card/views/card_campaign_views.xml

raw
1 <?xml version="1.0"?>
2 <odoo>
3 <record id="card_campaign_view_form" model="ir.ui.view">
4 <field name="name">card.campaign.view.form</field>
5 <field name="model">card.campaign</field>
6 <field name="arch" type="xml">
7 <form string="Share Campaign" class="o_card_campaign_form">
8 <header invisible="not active" class="mb-2">
9 <button name="action_share" type="object" class="btn-primary">Send</button>
10 <button name="action_preview" type="object" class="btn-secondary" invisible="not preview_record_ref">Preview</button>
11 </header>
12 <sheet>
13 <div class="oe_button_box" name="button_box">
14 <button name="action_view_mailings" type="object" icon="fa-envelope">
15 <div class="o_stat_info">
16 <span class="o_stat_text">
17 Mailings
18 </span>
19 <span class="o_stat_value">
20 <field name="mailing_count" readonly="1"/>
21 </span>
22 </div>
23 </button>
24 <button icon="fa-mouse-pointer">
25 <div class="o_stat_info">
26 <span class="o_stat_text">
27 Clicks
28 </span>
29 <span class="o_stat_value">
30 <field name="target_url_click_count" readonly="1"/>
31 </span>
32 </div>
33 </button>
34 <button name="action_view_cards" type="object" icon="fa-paper-plane">
35 <div class="o_stat_info">
36 <span class="o_stat_text">
37 Cards
38 </span>
39 <span class="o_stat_value">
40 <field name="card_count" readonly="1"/>
41 </span>
42 </div>
43 </button>
44 <button name="action_view_cards_clicked" type="object" icon="fa-eye">
45 <div class="o_stat_info">
46 <span class="o_stat_text">
47 Opened
48 </span>
49 <span class="o_stat_value">
50 <field name="card_click_count" readonly="1"/>
51 </span>
52 </div>
53 </button>
54 <button name="action_view_cards_shared" type="object" icon="fa-share">
55 <div class="o_stat_info">
56 <span class="o_stat_text">
57 Shared
58 </span>
59 <span class="o_stat_value">
60 <field name="card_share_count" readonly="1"/>
61 </span>
62 </div>
63 </button>
64 </div>
65 <widget name="web_ribbon" title="Archived" bg_color="text-bg-danger" invisible="active"/>
66 <div class="oe_title">
67 <h1>
68 <field name="name" placeholder="e.g. Odoo Experience Talks"/>
69 </h1>
70 </div>
71 <group>
72 <group>
73 <field name="preview_record_ref" string="Recipients" placeholder="Preview on..." options="{'no_create': True}"/>
74 <field name="target_url" placeholder="Your Home Page"/>
75 <field name="res_model" invisible="1"/><!--Get the default model for field pickers-->
76 <field name="res_model" groups="base.group_no_one"/>
77 <field name="post_suggestion" placeholder="Join me at this event!" widget="text_emojis"/>
78 </group>
79 <group>
80 <field name="user_id" widget="many2one_avatar"/>
81 <field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color', 'no_create_edit': True}"/>
82 </group>
83 </group>
84 <notebook>
85 <page name="Card Layout" string="Card Layout">
86 <group>
87 <group>
88 <field name="content_background" widget="image" class="w-25"/>
89 <label for="content_header"/>
90 <div class="d-flex">
91 <field name="content_header_dyn" title="Dynamic Field?"/>
92 <field name="content_header" invisible="content_header_dyn" placeholder="e.g. Join Odoo Experience 2024"/>
93 <field name="content_header_path" invisible="not content_header_dyn" placeholder="Select a field" widget="field_selector" options="{'model': 'res_model'}"/>
94 <field name="content_header_color" widget="color" class="ms-auto" style="min-width: 40px; max-width: 40px;"/>
95 </div>
96 <label for="content_sub_header"/>
97 <div class="d-flex">
98 <field name="content_sub_header_dyn"/>
99 <field name="content_sub_header" invisible="content_sub_header_dyn" placeholder="e.g. Aug 24, Brussels Expo"/>
100 <field name="content_sub_header_path" invisible="not content_sub_header_dyn" placeholder="Select a field" widget="field_selector" options="{'model': 'res_model'}"/>
101 <field name="content_sub_header_color" widget="color" class="ms-auto" style="min-width: 40px; max-width: 40px;"/>
102 </div>
103 <label for="content_section"/>
104 <div class="d-flex">
105 <field name="content_section_dyn"/>
106 <field name="content_section" invisible="content_section_dyn" placeholder="e.g. Sample Talk"/>
107 <field name="content_section_path" invisible="not content_section_dyn" placeholder="Select a field" widget="field_selector" options="{'model': 'res_model'}"/>
108 </div>
109 <label for="content_sub_section1"/>
110 <div class="d-flex">
111 <field name="content_sub_section1_dyn"/>
112 <field name="content_sub_section1" invisible="content_sub_section1_dyn" placeholder="e.g. By Lionel Messy"/>
113 <field name="content_sub_section1_path" invisible="not content_sub_section1_dyn" placeholder="Select a field" widget="field_selector" options="{'model': 'res_model'}"/>
114 </div>
115 <label for="content_sub_section2"/>
116 <div class="d-flex">
117 <field name="content_sub_section2_dyn"/>
118 <field name="content_sub_section2" invisible="content_sub_section2_dyn" placeholder="e.g. CFO Chief Football Officer"/>
119 <field name="content_sub_section2_path" invisible="not content_sub_section2_dyn" placeholder="Select a field" widget="field_selector" options="{'model': 'res_model'}"/>
120 </div>
121 <field name="content_image1_path" placeholder="Select a field" widget="field_selector" options="{'model': 'res_model'}"/>
122 <field name="content_image2_path" placeholder="Select a field" widget="field_selector" options="{'model': 'res_model'}"/>
123 <field name="content_button" placeholder="No button"/>
124 </group>
125 <group>
126 <field name="card_template_id" required="1" nolabel="1" colspan="2"
127 widget="selection_badge" options="{'size': 'sm'}"/>
128 <field name="image_preview" class="o_marketing_card_image_preview" nolabel="1" colspan="2"
129 invisible="not card_template_id" widget="image" options="{'size': [0, 500]}"/>
130 </group>
131 </group>
132 </page>
133 <page name="Recipient Message" string="Recipient Message">
134 <group>
135 <group>
136 <field name="request_title"/>
137 <field name="request_description" placeholder="e.g. Why people should share on their network?"/>
138 </group>
139 <group>
140 <field name="reward_target_url" placeholder='e.g. "https://www.mycompany.com/reward"'/>
141 <field name="reward_message" placeholder='e.g. "Thanks for sharing, here is your reward!"'/>
142 </group>
143 </group>
144 </page>
145 </notebook>
146 </sheet>
147 <chatter reload_on_post="True"/>
148 </form>
149 </field>
150 </record>
151
152 <record id="card_campaign_view_kanban" model="ir.ui.view">
153 <field name="name">card.campaign.view.kanban</field>
154 <field name="model">card.campaign</field>
155 <field name="arch" type="xml">
156 <kanban sample="1">
157 <templates>
158 <t t-name="card" class="o_marketing_card_campaign_kanban">
159 <field name="name" class="fw-bolder fs-5"/>
160 <field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color'}" class="mt-2"/>
161 <footer class="pt-0">
162 <div>
163 <a type="object" name="action_view_cards_shared" href="#" class="me-1">
164 <span class="badge rounded-pill">
165 <i class="fa fa-fw fa-share" aria-label="Shares" role="img" title="Shares"/>
166 <field name="card_share_count"/>
167 </span>
168 </a>
169 <a type="object" name="action_view_cards_clicked" href="#" class="me-1">
170 <span class="badge rounded-pill">
171 <i class="fa fa-fw fa-mouse-pointer" aria-label="Clicks" role="img" title="Clicks"/>
172 <field name="target_url_click_count"/>
173 </span>
174 </a>
175 </div>
176 <field name="user_id" class="ms-auto" widget="many2one_avatar_user"/>
177 </footer>
178 </t>
179 </templates>
180 </kanban>
181 </field>
182 </record>
183
184 <record id="card_campaign_view_tree" model="ir.ui.view">
185 <field name="name">card.campaign.view.list</field>
186 <field name="model">card.campaign</field>
187 <field name="arch" type="xml">
188 <list sample="1">
189 <field name="create_date"/>
190 <field name="name"/>
191 <field name="user_id" widget="many2one_avatar"/>
192 <field name="res_model" optional="hide"/>
193 <field name="target_url" optional="hide"/>
194 <field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color'}"/>
195 </list>
196 </field>
197 </record>
198
199 <record id="card_campaign_view_search" model="ir.ui.view">
200 <field name="name">card.campaign.view.search</field>
201 <field name="model">card.campaign</field>
202 <field name="arch" type="xml">
203 <search string="Search Share Campaign">
204 <filter string="My Campaigns" name="my_campaigns" domain="[('user_id', '=', uid)]"/>
205 <separator/>
206 <filter string="Archived" name="archived" domain="[('active', '=', False)]"/>
207 <field name="name"/>
208 <field name="tag_ids"/>
209 <separator/>
210 <group>
211 <filter string="Responsible" name="by_responsible" domain="[]" context="{'group_by': 'user_id'}"/>
212 <filter string="Tags" name="by_tags" domain="[]" context="{'group_by': 'tag_ids'}"/>
213 </group>
214 </search>
215 </field>
216 </record>
217
218
219 <record id="card_campaign_action" model="ir.actions.act_window">
220 <field name="name">Card Campaign</field>
221 <field name="res_model">card.campaign</field>
222 <field name="search_view_id" ref="card_campaign_view_search"/>
223 <field name="view_mode">list,kanban,form</field>
224 <field name="help" type="html">
225 <p class="o_view_nocontent_smiling_face">Create a Sharing Campaign!</p>
226 <p>Prepare a design and some content and let your community spread the word!</p>
227 </field>
228 </record>
229
230 </odoo>