[FW][FIX] web,event,mail,crm: fix form views

Purpose
=======
Fix the inline input fields which width seems broken
because of the new always edit mode.

Specifications
===========
Web :
Introduce new css classes to be added to the
input fields in order to constraint their width and avoid
white gaps in forms.

Event :
Limit the size of the confirmed attendees input
field in the event form and event type form to
display the confirmed attendees message in one line.
When using the debug mode, in the event templates,
inline the Register Button with its checkbox to avoid
line breaks.

Mail :
Limit the size of the delay count input
field in the activity type form and restore the
inline display of the schedule message to
avoid unnecessary white gaps.

CRM :
Fix the leads generation form inlined inputs
display by reducing the inputs width to match
their content display.
Fix the lead form view to align the expected
revenue with the probability for better UI.
Fix the geolocation field and send email button
of the Assigned Partner form tab by restoring
their inline property. Because of the form
grid layout, nested groups had to be used to
correctly restore the display. Alternative solutions
modify the DOM too much, which could lead to more
xpath and inheritance issues.

Task-2996467

closes odoo/odoo#106570

See: odoo/enterprise#32460
Forward-port-of: odoo/odoo#102546
Related: odoo/enterprise#34402
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
Odoo's Mergebot
2022-11-25 18:55:30 +01:00
committed by GitHub
8 changed files with 63 additions and 59 deletions
+23 -23
View File
@@ -50,42 +50,42 @@
<widget name="web_ribbon" title="Won" attrs="{'invisible': [('probability', '&lt;', 100)]}" />
<div class="oe_title">
<h1><field class="text-break" name="name" placeholder="e.g. Product Pricing"/></h1>
<h2 class="o_row g-0 align-items-end">
<div class="col" attrs="{'invisible': [('type', '=', 'lead')]}">
<label for="expected_revenue" class="oe_edit_only" />
<div class="o_row">
<h2 class="d-flex gap-2 g-0 align-items-end pb-3">
<div attrs="{'invisible': [('type', '=', 'lead')]}">
<label for="expected_revenue" class="oe_edit_only pb-1" />
<div class="d-flex align-items-end">
<field name="company_currency" invisible="1"/>
<field name="expected_revenue" class="oe_inline" widget='monetary' options="{'currency_field': 'company_currency'}"/>
<field name="expected_revenue" class="oe_inline o_input_8ch" widget='monetary' options="{'currency_field': 'company_currency'}"/>
<span class="oe_grey p-2" groups="crm.group_use_recurring_revenues"> + </span>
<span class="oe_grey p-2" groups="!crm.group_use_recurring_revenues"> at </span>
</div>
</div>
<div class="col" attrs="{'invisible': [('type', '=', 'lead')]}" groups="crm.group_use_recurring_revenues">
<div class="o_row">
<field name="recurring_revenue" class="pe-2 oe_inline" widget="monetary" options="{'currency_field': 'company_currency'}"/>
</div>
<div attrs="{'invisible': [('type', '=', 'lead')]}" groups="crm.group_use_recurring_revenues">
<field name="recurring_revenue" class="oe_inline o_input_10ch" widget="monetary" options="{'currency_field': 'company_currency'}"/>
</div>
<div class="col" attrs="{'invisible': [('type', '=', 'lead')]}" groups="crm.group_use_recurring_revenues">
<div class="o_row">
<field name="recurring_plan" class="oe_inline" placeholder="E.g. Monthly"
<div attrs="{'invisible': [('type', '=', 'lead')]}" groups="crm.group_use_recurring_revenues">
<div class="d-flex align-items-end ps-2">
<field name="recurring_plan" class="oe_inline o_input_12ch" placeholder="E.g. Monthly"
attrs="{'required': [('recurring_revenue', '!=', 0)]}" options="{'no_create': True, 'no_open': True}"/>
<span class="oe_grey p-2"> at </span>
</div>
</div>
<div class="col">
<div class="oe_edit_only d-flex align-items-center">
<div>
<div class="oe_edit_only d-md-flex align-items-center">
<label for="probability"/>
<button class="btn btn-link" name="action_set_automated_probability" type="object"
attrs="{'invisible': [('is_automated_probability', '=', True)]}">
<i class="fa fa-gear" role="img" title="Switch to automatic probability" aria-label="Switch to automatic probability"></i>
</button>
<small class="oe_grey h6 mb0" attrs="{'invisible': [('is_automated_probability', '=', True)]}">
<field class="mb0" name="automated_probability" force_save="1"/> %
</small>
<div class="d-flex align-items-center">
<button class="ps-0 ps-md-2 btn btn-link" name="action_set_automated_probability" type="object"
attrs="{'invisible': [('is_automated_probability', '=', True)]}">
<i class="fa fa-gear" role="img" title="Switch to automatic probability" aria-label="Switch to automatic probability"></i>
</button>
<small class="oe_grey h6 mb0 d-flex" attrs="{'invisible': [('is_automated_probability', '=', True)]}">
<field class="mb0" name="automated_probability" force_save="1"/> %
</small>
</div>
</div>
<div id="probability" class="o_row d-flex">
<div id="probability" class="d-inline-block">
<field name="is_automated_probability" invisible="1"/>
<field name="probability" widget="float" class="oe_inline"/>
<field name="probability" widget="float" class="oe_inline o_input_6ch"/>
<span class="oe_grey"> %</span>
</div>
</div>
@@ -51,9 +51,9 @@
<group name="requests">
<group>
<div class="o_row">
<field name="lead_number" attrs="{'readonly': [('state', '=', 'done')]}" nolabel="1" class="oe_inline col-md-2 ps-0"/>
<field name="search_type" widget="selection" attrs="{'readonly': [('state', '=', 'done')]}" nolabel="1" class="oe_inline col-md-6"/>
<div class="o_row py-3">
<field name="lead_number" attrs="{'readonly': [('state', '=', 'done')]}" nolabel="1" class="oe_inline pe-2 o_input_3ch"/>
<field name="search_type" widget="selection" attrs="{'readonly': [('state', '=', 'done')]}" nolabel="1" class="oe_inline"/>
</div>
</group>
</group>
@@ -70,9 +70,9 @@
<label for="company_size_min" attrs="{'invisible': [('filter_on_size', '=', False)]}"/>
<div attrs="{'invisible': [('filter_on_size', '=', False)]}">
From
<field name="company_size_min" class="oe_inline col-sm-3" attrs="{'required': [('filter_on_size', '=', True)], 'readonly': [('state', '=', 'done')]}"/>
<field name="company_size_min" class="oe_inline px-2 o_input_5ch" attrs="{'required': [('filter_on_size', '=', True)], 'readonly': [('state', '=', 'done')]}"/>
to
<field name="company_size_max" class="oe_inline col-sm-3" attrs="{'required': [('filter_on_size', '=', True)], 'readonly': [('state', '=', 'done')]}"/>
<field name="company_size_max" class="oe_inline px-2 o_input_7ch" attrs="{'required': [('filter_on_size', '=', True)], 'readonly': [('state', '=', 'done')]}"/>
employees
</div>
@@ -86,8 +86,8 @@
</group>
<group name="contacts" attrs="{'invisible': [('search_type', '!=', 'people')]}">
<div>
<field name="contact_number" attrs="{'readonly': [('state', '=', 'done')], 'required': [('search_type', '=', 'people')]}" nolabel="1" class="col-md-1"/>
<div colspan="2" class="py-3">
<field name="contact_number" attrs="{'readonly': [('state', '=', 'done')], 'required': [('search_type', '=', 'people')]}" nolabel="1" class="oe_inline pe-2 col-md-1 o_input_2ch"/>
<span class="col-md-6">Extra contacts per Company</span>
</div>
</group>
+1 -1
View File
@@ -60,7 +60,7 @@
<label for="seats_limited" string="Limit Registrations"/>
<div>
<field name="seats_limited"/>
<span attrs="{'invisible': [('seats_limited', '=', False)], 'required': [('seats_limited', '=', False)]}">to <field name="seats_max" class="oe_inline"/> Confirmed Attendees</span>
<span attrs="{'invisible': [('seats_limited', '=', False)], 'required': [('seats_limited', '=', False)]}">to <field name="seats_max" class="oe_inline o_input_9ch"/> Confirmed Attendees</span>
</div>
<field name="auto_confirm"/>
</group>
+1 -1
View File
@@ -22,7 +22,7 @@
<div>
<field name="has_seats_limitation"/>
<span attrs="{'invisible': [('has_seats_limitation', '=', False)], 'required': [('has_seats_limitation', '=', False)]}">
to <field name="seats_max" class="oe_inline"/>
to <field name="seats_max" class="oe_inline o_input_9ch"/>
Confirmed Attendees
</span>
</div>
+3 -5
View File
@@ -37,11 +37,9 @@
context="{'default_model': res_model}"/>
<label for="delay_count"/>
<div>
<div class="o_row">
<field class="col-1 ps-0 pe-0" name="delay_count"/>
<field class="col-3 ps-1 pe-1" name="delay_unit"/>
<field name="delay_from"/>
</div>
<field class="oe_inline pe-1 o_input_3ch" name="delay_count"/>
<field class="oe_inline ps-1 pe-2" name="delay_unit"/>
<field class="oe_inline" name="delay_from"/>
</div>
</group>
</group>
@@ -95,6 +95,11 @@
@extend .oe_inline;
float: right!important;
}
@for $i from 2 through 12 {
.o_field_widget.o_input_#{$i}ch input{
width: 1ch * $i !important;
}
}
.o_field_empty:empty {
min-height: $font-size-base * $line-height-base;
@@ -7,27 +7,28 @@
<field name="arch" type="xml">
<xpath expr="//notebook/page[last()]" position="after">
<page string="Assigned Partner" name="assigned_partner" groups="sales_team.group_sale_salesman">
<group col="3">
<label for="partner_latitude" string="Geolocation"/>
<div class="o_row">
<span class="oe_grey">( </span>
<field name="partner_latitude"/>
<span class="oe_grey" attrs="{'invisible':[('partner_latitude','&lt;=',0)]}">N </span>
<span class="oe_grey" attrs="{'invisible':[('partner_latitude','&gt;=',0)]}">S </span>
<field name="partner_longitude"/>
<span class="oe_grey" attrs="{'invisible':[('partner_longitude','&lt;=',0)]}">E </span>
<span class="oe_grey" attrs="{'invisible':[('partner_longitude','&gt;=',0)]}">W </span>
<span class="oe_grey">) </span>
</div>
<div colspan="2">
<button string="Automatic Assignment" name="action_assign_partner" type="object" class="btn-link"/>
</div>
<field name="partner_assigned_id" domain="[('grade_id','!=',False)]" context="{'partner_set_default_grade_activation': 1}"/>
<button string="Send Email" type="action" class="btn-link"
attrs="{'invisible':[('partner_assigned_id','=',False)]}"
name="%(crm_lead_forward_to_partner_act)d"
context="{'default_composition_mode': 'forward','hide_forward_type': 1 , 'default_partner_ids': [partner_assigned_id]}"/>
<group>
<group col="2">
<label for="partner_latitude" string="Geolocation"/>
<div>
<span class="oe_grey">( </span>
<field name="partner_latitude" class="oe_inline o_input_12ch px-1"/>
<span class="oe_grey" attrs="{'invisible':[('partner_latitude','&lt;=',0)]}">N </span>
<span class="oe_grey" attrs="{'invisible':[('partner_latitude','&gt;=',0)]}">S </span>
<field name="partner_longitude" class="oe_inline o_input_12ch ps-2 pe-1"/>
<span class="oe_grey" attrs="{'invisible':[('partner_longitude','&lt;=',0)]}">E </span>
<span class="oe_grey" attrs="{'invisible':[('partner_longitude','&gt;=',0)]}">W </span>
<span class="oe_grey ps-1">) </span>
</div>
<field name="partner_assigned_id" domain="[('grade_id','!=',False)]" context="{'partner_set_default_grade_activation': 1}"/>
</group>
<group>
<button colspan="2" string="Automatic Assignment" name="action_assign_partner" type="object" class="btn-link pt-0 ps-0"/>
<button colspan="2" string="Send Email" type="action" class="btn-link pt-0 ps-0"
attrs="{'invisible':[('partner_assigned_id','=',False)]}"
name="%(crm_lead_forward_to_partner_act)d"
context="{'default_composition_mode': 'forward','hide_forward_type': 1 , 'default_partner_ids': [partner_assigned_id]}"/>
</group>
</group>
</page>
</xpath>
@@ -15,7 +15,7 @@
<label for="community_menu" string="Community"/>
<field name="community_menu"/>
</span>
<span name="menu_register_cta">
<span name="menu_register_cta" class="d-inline-block">
<label for="menu_register_cta" string="Register Button"/>
<field name="menu_register_cta"/>
</span>