[FIX] {base, coupon, crm, event, mass_mailing, product, project, sales_team, utm, web}: prevent long texts from overflowing

Previously, in multiple modules, long names would result in an overflow of text.
With this commit long texts should appear like this: [aaaaa...] instead of
going out of their boxes.

Various views are updated, depending on which fields we wanted to prevent
from overflowing and the probability they do so.

Task ID-2325219
PR odoo/odoo#57713
PR odoo/enterprise#13226

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
Pedro (pno)
2020-11-04 07:32:27 +00:00
committed by Thibault Delavallée
parent 16908e9eac
commit a0ebb46098
14 changed files with 40 additions and 31 deletions
+3 -3
View File
@@ -10,7 +10,7 @@
<sheet>
<div class="oe_button_box" name="button_box" />
<widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
<div name="title" class="oe_left">
<div name="title" class="oe_left mw-100">
</div>
<group>
<group name="conditions" string="Conditions">
@@ -139,7 +139,7 @@
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_card oe_kanban_global_click">
<div class="text-center">
<div class="text-center oe_kanban_details">
<strong><span><field name="name"/></span></strong>
</div>
<hr class="mt4 mb4"/>
@@ -192,7 +192,7 @@
<field name="arch" type="xml">
<xpath expr="//div[@name='title']" position="inside">
<label class="oe_edit_only" for="name" string="Promotion Program Name"/>
<h1><field name="name" class="oe_title" placeholder="Promotion Program Name..." height="20px"/></h1>
<h1><field name="name" class="oe_title o_text_overflow" placeholder="Promotion Program Name..." height="20px"/></h1>
</xpath>
<xpath expr="//div[@name='button_box']" position="inside">
<button class="oe_stat_button" type="action" icon="fa-ticket" name="%(coupon.coupon_action)d" attrs="{'invisible': [('promo_applicability', '=', 'on_current_order')]}">
+3 -3
View File
@@ -44,7 +44,7 @@
<div class="oe_title">
<label for="name" class="oe_edit_only" string="Lead" attrs="{'invisible': [('type', '=', 'opportunity')]}"/>
<label for="name" class="oe_edit_only" attrs="{'invisible': [('type', '=', 'lead')]}"/>
<h1><field name="name" placeholder="e.g. Product Pricing"/></h1>
<h1><field class="o_text_overflow" name="name" placeholder="e.g. Product Pricing"/></h1>
<h2 class="o_row no-gutters align-items-end">
<div class="col" attrs="{'invisible': [('type', '=', 'lead')]}">
<label for="expected_revenue" class="oe_edit_only" />
@@ -504,7 +504,7 @@
</div>
</div>
<div class="oe_kanban_content">
<div class="o_kanban_record_title">
<div class="o_kanban_record_title oe_kanban_details">
<strong><field name="name"/></strong>
</div>
<div class="o_kanban_record_subtitle">
@@ -518,7 +518,7 @@
</t>
</div>
<div>
<span t-if="record.partner_id.value" t-esc="record.partner_id.value"></span>
<span class="o_text_overflow" t-if="record.partner_id.value" t-esc="record.partner_id.value"></span>
</div>
<div>
<field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color'}"/>
+6 -6
View File
@@ -219,7 +219,7 @@
<field name="kanban_state" widget="state_selection" class="ml-auto float-right"/>
<div class="oe_title">
<label for="name" class="oe_edit_only" string="Event Name"/>
<h1><field name="name" placeholder="e.g. Conference for Architects"/></h1>
<h1><field class="o_text_overflow" name="name" placeholder="e.g. Conference for Architects"/></h1>
</div>
<group>
<group>
@@ -544,13 +544,13 @@
<group>
<group string="Attendee" name="attendee">
<field name="partner_id" attrs="{'readonly':[('state', '!=', 'draft')]}"/>
<field name="name"/>
<field class="o_text_overflow" name="name"/>
<field name="email"/>
<field name="phone" class="o_force_ltr"/>
<field name="mobile" class="o_force_ltr"/>
</group>
<group string="Event Information" name="event">
<field name="event_id" attrs="{'readonly': [('state', '!=', 'draft')]}" options="{'no_create': True}"/>
<field class="o_text_overflow" name="event_id" attrs="{'readonly': [('state', '!=', 'draft')]}" options="{'no_create': True}"/>
<field name="event_ticket_id"
domain="[
('event_id', '=', event_id),
@@ -626,12 +626,12 @@
<div class="oe_kanban_content h-100">
<div class="o_kanban_record_body pt-1 pl-2 h-100 d-flex flex-column">
<b class="o_kanban_record_title"><field name="name"/></b>
<field name="event_id" invisible="context.get('default_event_id')" />
<span attrs="{'invisible': [('partner_id', '=', False)]}">Booked by <field name="partner_id" /></span>
<field class="o_text_overflow" name="event_id" invisible="context.get('default_event_id')" />
<span class="o_text_overflow" attrs="{'invisible': [('partner_id', '=', False)]}">Booked by <field name="partner_id" /></span>
<div id="event_ticket_id" class="o_field_many2manytags o_field_widget d-flex mt-auto">
<t t-if="record.event_ticket_id.raw_value">
<div t-attf-class="badge badge-pill o_tag_color_#{(record.event_ticket_id.raw_value % 11) + 1}" >
<b><span class="o_badge_text"><t t-esc="record.event_ticket_id.value"/></span></b>
<b><span class="o_badge_text o_text_overflow"><t t-esc="record.event_ticket_id.value"/></span></b>
</div>
</t>
</div>
@@ -153,7 +153,7 @@
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1>
<field name="name" placeholder="e.g. John Smith"/>
<field class="o_text_overflow" name="name" placeholder="e.g. John Smith"/>
</h1>
<label for="tag_ids" class="oe_edit_only"/>
<div>
@@ -47,7 +47,7 @@
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1>
<field name="name" placeholder="e.g. Consumer Newsletter"/>
<field name="name" class="o_text_overflow" placeholder="e.g. Consumer Newsletter"/>
</h1>
</div>
<group>
@@ -107,7 +107,7 @@
<div class="o_mass_mailing_kanban_main">
<div class="o_kanban_card_content">
<div class="o_kanban_primary_left">
<div class="o_primary">
<div class="o_primary o_text_overflow">
<span><t t-esc="record.name.value"/></span>
</div>
</div>
@@ -158,8 +158,8 @@
<field name="active" invisible="1"/>
<field name="mailing_type" widget="radio" options="{'horizontal': true}" invisible="1"
attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
<field name="subject" string="Subject" attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}" widget="char_emojis" placeholder="e.g. New Sale on all T-shirts"/>
<field name="preview" string="Preview Text" attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}" widget="char_emojis" placeholder="e.g. Check it out before it's too late!"/>
<field class="o_text_overflow" name="subject" string="Subject" attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}" widget="char_emojis" placeholder="e.g. New Sale on all T-shirts"/>
<field class="o_text_overflow" name="preview" string="Preview Text" attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}" widget="char_emojis" placeholder="e.g. Check it out before it's too late!"/>
<label for="mailing_model_id" string="Recipients"/>
<div name="mailing_model_id_container">
<div class="row">
@@ -216,7 +216,7 @@
<group>
<group>
<field name="id" invisible="1"/>
<field name="name" required="False" groups="base.group_no_one" string="Name"/>
<field name="name" required="False" groups="base.group_no_one" class="o_text_overflow" string="Name"/>
<field name="user_id" domain="[('share', '=', False)]"/>
<field name="email_from" attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
<label for="reply_to"/>
@@ -258,6 +258,7 @@
string="Source"
readonly="1"
required="False"
class="o_text_overflow"
groups="base.group_no_one"
attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
<field name="medium_id"
@@ -339,7 +340,7 @@
t-attf-style="width: #{record.delivered.raw_value * 100 / record.expected.raw_value}%"/>
</div>
</div>
<h3 class="my-1 o_text_overflow" attrs="{'invisible': [('sent_date', '!=', False)]}">
<h3 class="my-1" attrs="{'invisible': [('sent_date', '!=', False)]}">
<field name="subject"/>
</h3>
<field name="mailing_type" invisible="1"/>
@@ -100,7 +100,7 @@
For an SMS Text Message, internal Title of the Message.</attribute>
</xpath>
<xpath expr="//field[@name='subject']" position="after">
<field name="sms_subject" string="Title" attrs="{'invisible': [('mailing_type', '!=', 'sms')], 'readonly': [('state', 'in', ('sending', 'done'))], 'required': [('mailing_type', '=', 'sms')]}"/>
<field class="o_text_overflow" name="sms_subject" string="Title" attrs="{'invisible': [('mailing_type', '!=', 'sms')], 'readonly': [('state', 'in', ('sending', 'done'))], 'required': [('mailing_type', '=', 'sms')]}"/>
</xpath>
<xpath expr="//page[@name='mail_body']" position="attributes">
<attribute name="attrs">{'invisible': [('mailing_type', '!=', 'mail')]}</attribute>
+1 -1
View File
@@ -24,7 +24,7 @@
<field name="image_1920" widget="image" class="oe_avatar" options="{'preview_image': 'image_128'}"/>
<div class="oe_title">
<label class="oe_edit_only" for="name" string="Product Name"/>
<h1><field name="name" placeholder="Product Name"/></h1>
<h1><field class="o_text_overflow" name="name" placeholder="Product Name"/></h1>
<div name="options" groups="base.group_user">
<div>
<field name="sale_ok"/>
@@ -1,4 +1,9 @@
.o_kanban_view.o_kanban_dashboard.o_project_kanban {
.o_project_kanban_main {
max-width: 300px;
}
.o_project_kanban_boxes {
display: flex;
flex-flow: row wrap;
+4 -4
View File
@@ -275,7 +275,7 @@
<widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
<div class="oe_title">
<h1>
<field name="name" placeholder="Project Name"/>
<field name="name" class="o_text_overflow" placeholder="Project Name"/>
</h1>
<div name="options_active">
<div>
@@ -513,11 +513,11 @@
<t t-name="kanban-box">
<div t-attf-class="#{kanban_color(record.color.raw_value)} oe_kanban_global_click o_has_icon">
<div class="o_project_kanban_main">
<div class="o_kanban_card_content">
<div class="o_kanban_card_content mw-100">
<div class="o_kanban_primary_left">
<div class="o_primary">
<span><t t-esc="record.name.value"/></span>
<span t-if="record.partner_id.value">
<span class="o_text_overflow"><t t-esc="record.name.value"/></span>
<span class="o_text_overflow" t-if="record.partner_id.value">
<strong><t t-esc="record.partner_id.value"/></strong>
</span>
</div>
+2 -2
View File
@@ -27,7 +27,7 @@
<div class="oe_title">
<label for="name" class="oe_edit_only" string="Sales Team"/>
<h1>
<field name="name" placeholder="Sales Team name..."/>
<field class="o_text_overflow" name="name" placeholder="Sales Team name..."/>
</h1>
<div name="options_active" />
</div>
@@ -128,7 +128,7 @@
<div t-attf-class="#{!selection_mode ? kanban_color(record.color.raw_value) : ''}">
<div t-attf-class="o_kanban_card_header">
<div class="o_kanban_card_header_title">
<div class="o_primary"><field name="name"/></div>
<div class="o_primary o_text_overflow"><field name="name"/></div>
</div>
<div class="o_kanban_manage_button_section">
<a class="o_kanban_manage_toggle_button" href="#"><i class="fa fa-ellipsis-v" role="img" aria-label="Manage" title="Manage"/></a>
+2 -2
View File
@@ -30,7 +30,7 @@
<div class="oe_button_box d-flex justify-content-end" name="button_box">
</div>
<group id="top-group">
<field name="name" string="Campaign Name" placeholder="e.g. Black Friday"/>
<field class="o_text_overflow" name="name" string="Campaign Name" placeholder="e.g. Black Friday"/>
<field name="user_id" domain="[('share', '=', False)]"/>
<field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color', 'no_create_edit': True}"/>
</group>
@@ -61,7 +61,7 @@
<field name="arch" type="xml">
<form>
<group>
<field name="name" string="Campaign Name" placeholder="e.g. Black Friday"/>
<field class="o_text_overflow" name="name" string="Campaign Name" placeholder="e.g. Black Friday"/>
<field name="user_id" domain="[('share', '=', False)]"/>
<field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color', 'no_create_edit': True}"/>
</group>
+4 -1
View File
@@ -99,6 +99,8 @@
.o_kanban_record_title {
@include o-kanban-record-title($font-size: 13px);
overflow-wrap: break-word;
word-wrap: break-word;
}
.o_kanban_record_subtitle {
@@ -372,7 +374,8 @@
.oe_kanban_details {
width: 100%;
overflow-wrap: break-word;
word-wrap: break-word;
// Useful for the class 'o_text_overflow'
min-width: 0;
+1 -1
View File
@@ -159,7 +159,7 @@
class="oe_edit_only"
options="{'horizontal': true}"/>
<h1>
<field name="name" default_focus="1" placeholder="Name" attrs="{'required' : [('type', '=', 'contact')]}"/>
<field class="o_text_overflow" name="name" default_focus="1" placeholder="Name" attrs="{'required' : [('type', '=', 'contact')]}"/>
</h1>
<div class="o_row">
<field name="parent_id"