[IMP] utm,crm,mass_mailing,link_tracker,sale: improve utm.campaign kanban view

This commit slightly improves the utm.campaign kanban view by reordering statistics and changing
their display.

The recent changes introduced in 09c9d1f0d0 were not satisfying after all.

Task#2077579

closes odoo/odoo#37612

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Aurélien Warnon <awa@odoo.com>
This commit is contained in:
sri-odoo
2019-10-01 13:38:17 +00:00
committed by Aurélien Warnon
co-authored by Aurélien Warnon
parent 63de98b9b4
commit 2a10328c13
9 changed files with 72 additions and 33 deletions
+8 -6
View File
@@ -7,14 +7,16 @@
<field name="arch" type="xml">
<xpath expr="//div[@id='utm_statistics']" position="inside">
<field name="crm_lead_activated" invisible="1"/>
<div class="px-2 text-center" groups="sales_team.group_sale_salesman"
attrs="{'invisible': [('crm_lead_activated', '=', False)]}">
<small>Leads:</small>
<div class="mr-3"
groups="sales_team.group_sale_salesman"
attrs="{'invisible': [('crm_lead_activated', '=', False)]}" title="Leads">
<i class="fa fa-star text-muted"></i>
<small class="font-weight-bold"><field name="lead_count"/></small>
</div>
<div class="px-2 text-center" groups="sales_team.group_sale_salesman"
attrs="{'invisible': [('crm_lead_activated', '=', True)]}">
<small>Opportunities:</small>
<div class="mr-3"
groups="sales_team.group_sale_salesman"
attrs="{'invisible': [('crm_lead_activated', '=', True)]}" title="Opportunities">
<i class="fa fa-star text-muted"></i>
<small class="font-weight-bold"><field name="opportunity_count"/></small>
</div>
</xpath>
@@ -23,8 +23,8 @@
<field name="click_count"/>
</xpath>
<xpath expr="//div[@id='utm_statistics']" position="inside">
<div class="px-2 text-center">
<small>Clicks:</small>
<div class="mr-3" title="Clicks">
<i class="fa fa-mouse-pointer text-muted"></i>
<small class="font-weight-bold" t-esc="record.click_count.raw_value" />
</div>
</xpath>
@@ -80,9 +80,9 @@
<xpath expr="//field[@name='user_id']" position="after">
<field name="mailing_mail_ids"/>
</xpath>
<xpath expr="//div[hasclass('o_kanban_record_body')]">
<xpath expr="//ul[@id='o_utm_actions']">
<a name="%(action_view_mass_mailings_from_campaign)d" type="action"
class="oe_mailings o_kanban_record_subtitle d-inline-block">
t-attf-class="oe_mailings #{record.mailing_mail_ids.raw_value.length === 0 ? 'text-muted' : ''}">
<t t-raw="record.mailing_mail_ids.raw_value.length"/> Mailings
</a>
</xpath>
@@ -44,9 +44,9 @@
<xpath expr="//field[@name='user_id']" position="after">
<field name="mailing_sms_count"/>
</xpath>
<xpath expr="//div[hasclass('o_kanban_record_body')]">
<xpath expr="//ul[@id='o_utm_actions']">
<a name="action_redirect_to_mailing_sms" type="object"
class="oe_mailings o_kanban_record_subtitle d-inline-block">
t-attf-class="oe_mailings #{record.mailing_sms_count.raw_value === 0 ? 'text-muted' : ''}">
<t t-raw="record.mailing_sms_count.raw_value"/> SMS
</a>
</xpath>
+10 -10
View File
@@ -6,18 +6,18 @@
<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="px-2 text-center">
<small>Quotations:</small>
<small class="font-weight-bold">
<field name="quotation_count"/>
</small>
</div>
<div class="px-2 text-center">
<small>Revenues:</small>
<div class="mr-3" title="Revenues">
<field name="currency_id" invisible="True"/>
<small class="font-weight-bold">
<field name="invoiced_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
</small>
</div>
<div class="mr-3" title="Quotations">
<i class="fa fa-money text-muted"></i>
<small class="font-weight-bold">
<field name="quotation_count"/>
</small>
</div>
</xpath>
</field>
</record>
@@ -29,11 +29,11 @@
<field name="arch" type="xml">
<xpath expr="//div[hasclass('oe_button_box')]" position="inside">
<button name="action_redirect_to_invoiced"
type="object" class="oe_stat_button order-1" icon="fa-money">
type="object" class="oe_stat_button order-1" icon="fa-usd">
<field name="invoiced_amount" widget="statinfo" string="Revenues"/>
</button>
<button name="action_redirect_to_quotations"
type="object" class="oe_stat_button order-2" icon="fa-usd">
type="object" class="oe_stat_button order-2" icon="fa-money">
<field name="quotation_count" widget="statinfo" string="Quotations"/>
</button>
</xpath>
+2 -1
View File
@@ -8,9 +8,10 @@
Enable management of UTM trackers: campaign, medium, source.
""",
'version': '1.0',
'depends': ['base'],
'depends': ['base', 'web'],
'data': [
'data/utm_data.xml',
'views/assets.xml',
'views/utm_campaign_views.xml',
'views/utm_views.xml',
'security/ir.model.access.csv',
+27
View File
@@ -0,0 +1,27 @@
.o_kanban_view.o_utm_kanban {
.o_kanban_group {
padding: 0 ($grid-gutter-width * .25) $grid-gutter-width;
&:not(.o_column_folded) {
width: 380px;
}
}
#o_utm_actions {
margin: 0 ($o-kanban-dashboard-hpadding * -.5);
> a {
border-color: rgba($border-color, .5);
padding: ($o-kanban-dashboard-hpadding * .25) ($o-kanban-dashboard-hpadding * .5);
white-space: nowrap;
}
> :first-child {
border-left: 0;
}
> :last-child {
border-right: 0;
}
}
}
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="assets_backend" name="utm assets" inherit_id="web.assets_backend">
<xpath expr="link[last()]" position="after">
<link rel="stylesheet" type="text/scss" href="utm/static/src/scss/utm_views.scss"/>
</xpath>
</template>
</odoo>
+11 -10
View File
@@ -58,13 +58,13 @@
<field name="name">utm.campaign.view.kanban</field>
<field name="model">utm.campaign</field>
<field name="arch" type="xml">
<kanban default_group_by='stage_id'>
<kanban default_group_by='stage_id' class="o_utm_kanban">
<field name='color'/>
<field name='user_id'/>
<field name="stage_id"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click p-0">
<div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click">
<div class="o_dropdown_kanban dropdown">
<a role="button" class="dropdown-toggle o-no-caret btn" data-toggle="dropdown" href="#" aria-label="Dropdown menu" title="Dropdown menu">
<span class="fa fa-ellipsis-v"/>
@@ -82,19 +82,20 @@
</div>
</div>
<div class="oe_kanban_content">
<div class="o_kanban_record_top p-2">
<div class="o_kanban_record_top">
<div class="o_kanban_record_headings">
<h3 class="oe_margin_bottom_8 o_kanban_record_title"><field name="name"/></h3>
</div>
</div>
<div class="o_kanban_record_body px-2">
<div class="o_kanban_record_body">
<field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color'}"/>
<ul id="o_utm_actions" class="list-group list-group-horizontal"/>
</div>
<div id="utm_statistics" class="d-flex bg-100 px-3 py-1 border-bottom border-top justify-content-between"/>
<div class="d-flex flex-grow-0 flex-column align-items-end px-3 py-2">
<img t-att-src="kanban_image('res.users', 'image_128', record.user_id.raw_value)"
t-att-data-member_id="record.user_id.raw_value"
t-att-alt="record.user_id.raw_value" width="32" height="32" class="oe_kanban_avatar"/>
<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_right">
<img t-att-src="kanban_image('res.users', 'image_128', record.user_id.raw_value)" t-att-data-member_id="record.user_id.raw_value" t-att-alt="record.user_id.raw_value" width="32" height="32" class="oe_kanban_avatar"/>
</div>
</div>
</div>
<div class="oe_clear"></div>
@@ -163,4 +164,4 @@
</p>
</field>
</record>
</odoo>
</odoo>