Currently there is two ways in view to have a phone number displayed in
LTR in a RTL language:
- have `widget="phone"` on a field
- have a class o_force_ltr on the field
But this is currently done very rarely and fail in list view because the
direction of data cells is used, eg.:
```
<div style="direction:rtl">
<table><tr><td style="direction:ltr">
<span>+1 2 3</span>
</td></tr><tr><td>
<span style="direction:ltr">+4 5 6</span>
</td>/tr></table>
</div>
```
will be displayed as:
+1 2 3
6 5 4+
In this commit, we use unicode-bidi* to optionally add an additional
level of embedding so direction is taken into account by the
bidirectional algorithm.
This commit also adds o_force_ltr class or phone widget on phone fields
where it is not already defined.
*: https://drafts.csswg.org/css-writing-modes-3/#propdef-unicode-bidi
opw-2224828
closes #48425
closes odoo/odoo#48588
X-original-commit: ab067218e069f0a92610c3f0d4137e563e47755c
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
49 lines
2.4 KiB
XML
49 lines
2.4 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo><data>
|
|
<record id="website_visitor_view_form" model="ir.ui.view">
|
|
<field name="name">website.visitor.view.form.inherit.website.mass.mailing.sms</field>
|
|
<field name="model">website.visitor</field>
|
|
<field name="inherit_id" ref="website.website_visitor_view_form"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//header" position="inside">
|
|
<button name="action_send_sms" type="object" class="btn btn-primary"
|
|
attrs="{'invisible': [('mobile', '=', False)]}" string="Send SMS"/>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="website_visitor_view_kanban" model="ir.ui.view">
|
|
<field name="name">website.visitor.view.kanban.inherit.website.sms</field>
|
|
<field name="model">website.visitor</field>
|
|
<field name="inherit_id" ref="website.website_visitor_view_kanban"/>
|
|
<field name="arch" type="xml">
|
|
<field name="page_ids" position="after">
|
|
<field name="mobile" widget="phone"/>
|
|
</field>
|
|
<xpath expr="//div[hasclass('w_visitor_kanban_actions')]" position="inside">
|
|
<button name="action_send_sms" type="object" class="btn btn-secondary"
|
|
attrs="{'invisible': [('mobile', '=', False)]}">SMS
|
|
</button>
|
|
</xpath>
|
|
<xpath expr="//div[hasclass('w_visitor_kanban_actions_ungrouped')]" position="inside">
|
|
<button name="action_send_sms" type="object" class="btn btn-secondary border"
|
|
attrs="{'invisible': [('mobile', '=', False)]}">SMS
|
|
</button>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="website_visitor_view_tree" model="ir.ui.view">
|
|
<field name="name">website.visitor.view.tree.inherit.website.sms</field>
|
|
<field name="model">website.visitor</field>
|
|
<field name="inherit_id" ref="website.website_visitor_view_tree"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//button[@name='action_send_mail']" position="after">
|
|
<field name="mobile" invisible="1"/>
|
|
<button name="action_send_sms" type="object" icon="fa-mobile"
|
|
attrs="{'invisible': [('mobile', '=', False)]}" string="Send SMS"/>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
</data></odoo>
|