[IMP] utm,sale,link_tracker,crm: change kanban icons to buttons

Change the icons of the utm campaign kanban cards to buttons.
This allows a faster access to concerned views.

Task-3240966

Part-of: odoo/odoo#116230
This commit is contained in:
amdi-odoo
2023-04-19 11:00:59 +02:00
parent 7f6c66bd5e
commit efac0ab86e
4 changed files with 41 additions and 21 deletions
+15 -6
View File
@@ -8,12 +8,21 @@
<xpath expr="//field[@name='user_id']" position="after">
<field name="use_leads"/>
</xpath>
<xpath expr="//div[@id='utm_statistics']" position="inside">
<div class="me-3"
groups="sales_team.group_sale_salesman"
t-att-title="record.use_leads.raw_value ? 'Leads' : 'Opportunities'">
<i class="fa fa-star text-muted"></i> <small class="fw-bold"><field name="crm_lead_count"/></small>
</div>
<xpath expr="//div[hasclass('oe_kanban_bottom_left')]" position="inside">
<t t-if="record.use_leads.raw_value">
<t t-set="crm_lead_count_label">Leads</t>
</t>
<t t-else="">
<t t-set="crm_lead_count_label">Opportunities</t>
</t>
<a t-if="record.crm_lead_count" href="#" t-att-title="crm_lead_count_label" role="button"
groups="sales_team.group_sale_salesman" data-type="object" data-name="action_redirect_to_leads_opportunities"
class="oe_kanban_action oe_kanban_action_a btn-outline-primary rounded-pill me-1 order-3">
<span class="badge">
<i class="fa fa-fw fa-star" t-att-aria-label="crm_lead_count_label" role="img"/>
<field name="crm_lead_count"/>
</span>
</a>
</xpath>
</field>
</record>
@@ -22,12 +22,16 @@
<xpath expr="//field[@name='stage_id']" position="after">
<field name="click_count"/>
</xpath>
<xpath expr="//div[@id='utm_statistics']" position="inside">
<div class="me-3" title="Clicks">
<i class="fa fa-mouse-pointer text-muted"></i> <small class="fw-bold" t-esc="record.click_count.raw_value" />
</div>
<xpath expr="//div[hasclass('oe_kanban_bottom_left')]" position="inside">
<a t-if="record.click_count" href="#" title="Clicks" role="button"
data-type="action" data-name="%(link_tracker_action_campaign)d"
class="oe_kanban_action oe_kanban_action_a btn-outline-primary rounded-pill me-1 order-4">
<span class="badge">
<i class="fa fa-fw fa-mouse-pointer" aria-label="Clicks" role="img"/>
<t t-out="record.click_count.raw_value"/>
</span>
</a>
</xpath>
</field>
</record>
</odoo>
+16 -9
View File
@@ -6,16 +6,23 @@
<field name="model">utm.campaign</field>
<field name="inherit_id" ref="utm.utm_campaign_view_kanban"/>
<field name="arch" type="xml">
<xpath expr="//div[@id='utm_statistics']" position="inside">
<div class="me-3" title="Revenues" groups="sales_team.group_sale_salesman">
<field name="currency_id" invisible="True"/>
<small class="fw-bold">
<xpath expr="//div[hasclass('oe_kanban_bottom_left')]" position="inside">
<a t-if="record.invoiced_amount" href="#" title="Revenues" role="button"
groups="sales_team.group_sale_salesman" data-type="object" data-name="action_redirect_to_invoiced"
class="oe_kanban_action oe_kanban_action_a btn-outline-primary rounded-pill me-1 order-1">
<span class="badge">
<field name="currency_id" invisible="True"/>
<field name="invoiced_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
</small>
</div>
<div class="me-3" title="Quotations" groups="sales_team.group_sale_salesman">
<i class="fa fa-money text-muted"></i> <small class="fw-bold"><field name="quotation_count"/></small>
</div>
</span>
</a>
<a t-if="record.quotation_count" href="#" title="Quotations" role="button"
groups="sales_team.group_sale_salesman" data-type="object" data-name="action_redirect_to_quotations"
class="oe_kanban_action oe_kanban_action_a btn-outline-primary rounded-pill me-1 order-2">
<span class="badge">
<i class="fa fa-fw fa-money me-1" aria-label="Quotations" role="img"/>
<field name="quotation_count"/>
</span>
</a>
</xpath>
</field>
</record>
+1 -1
View File
@@ -113,7 +113,7 @@
<ul id="o_utm_actions" class="list-group list-group-horizontal my-0"/>
</div>
<div class="o_kanban_record_bottom h5 mt-2 mb-0">
<div id="utm_statistics" class="d-flex flex-grow-1 text-600 mt-1"/>
<div class="oe_kanban_bottom_left py-auto"/>
<div class="oe_kanban_bottom_right">
<field name="user_id" widget="many2one_avatar_user"/>
</div>