[FIX] web,*: whitespaces in form/kanban templates

*: crm,link_tracker,project,sale,utm

Before this commit, in some form and kanban views, there were
missing whitespaces, typically between icons and texts. This was
due to the transition to owl views, because we simply ignored
` ` in archs. This commit also fixes a layout issue in
a project view, where the icon and the field should be displayed
in the same line.

closes odoo/odoo#101040

X-original-commit: f5813e348b6052436a4fabaa5837ecc37b15430e
Related: odoo/enterprise#31746
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit is contained in:
luvi
2022-09-26 08:38:35 +02:00
committed by Aaron Bohy
parent b2d00200e7
commit 1fa4f1dc10
6 changed files with 8 additions and 14 deletions
+1 -2
View File
@@ -12,8 +12,7 @@
<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>
<i class="fa fa-star text-muted"></i> <small class="fw-bold"><field name="crm_lead_count"/></small>
</div>
</xpath>
</field>
@@ -24,8 +24,7 @@
</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" />
<i class="fa fa-mouse-pointer text-muted"></i> <small class="fw-bold" t-esc="record.click_count.raw_value" />
</div>
</xpath>
</field>
+2 -3
View File
@@ -521,11 +521,10 @@
<field name="analytic_account_id" domain="['|', ('company_id', '=', company_id), ('company_id', '=', False)]" context="{'default_partner_id': partner_id}" groups="analytic.group_analytic_accounting"/>
<field name="privacy_visibility" widget="radio"/>
<span colspan="2" class="text-muted" attrs="{'invisible':[('access_instruction_message', '=', '')]}">
<i class="fa fa-lightbulb-o"/>&amp;nbsp;<field name="access_instruction_message" nolabel="1"/>
<i class="fa fa-lightbulb-o"/>&amp;nbsp;<field class="d-inline" name="access_instruction_message" nolabel="1"/>
</span>
<span colspan="2" class="text-muted" attrs="{'invisible':[('privacy_visibility_warning', '=', '')]}">
<i class="fa fa-warning">&amp;nbsp;</i>
<field name="privacy_visibility_warning" nolabel="1"/>
<i class="fa fa-warning"/>&amp;nbsp;<field class="d-inline" name="privacy_visibility_warning" nolabel="1"/>
</span>
</group>
<group>
+1 -4
View File
@@ -14,10 +14,7 @@
</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>
<i class="fa fa-money text-muted"></i> <small class="fw-bold"><field name="quotation_count"/></small>
</div>
</xpath>
</field>
@@ -4,8 +4,6 @@
--KanbanGroup-padding-bottom: #{$grid-gutter-width};
#o_utm_actions {
margin: 0 calc(var(--KanbanRecord-padding-h) * -1);
> a {
padding: var(--KanbanRecord-gap-inner-v) var(--KanbanRecord-padding-h);
white-space: nowrap;
+3 -1
View File
@@ -1,5 +1,7 @@
/** @odoo-module **/
import { nbsp } from "@web/core/utils/strings";
/**
* XML document to create new elements from. The fact that this is a "text/xml"
* document ensures that tagNames and attribute names are case sensitive.
@@ -47,7 +49,7 @@ export class XMLParser {
* @returns {Element}
*/
parseXML(arch) {
const cleanedArch = arch.replace(/&amp;nbsp;/g, "");
const cleanedArch = arch.replace(/&amp;nbsp;/g, nbsp);
const xml = parser.parseFromString(cleanedArch, "text/xml");
if (hasParsingError(xml)) {
throw new Error(