diff options
| author | XavierDo <xdo@odoo.com> | 2018-03-20 16:22:02 +0100 |
|---|---|---|
| committer | XavierDo <xdo@odoo.com> | 2018-06-07 11:46:28 +0200 |
| commit | aa7fb8c72317e330bbeb6ce29b4aace8627ef1d7 (patch) | |
| tree | f740ce0ab63d0db2d4885faaac237e6ed5304b4b | |
| parent | 2ab7ad83618dcffd32b39e3a54ae500514444476 (diff) | |
[IMP] mail: add warning when partner email is invalid
Change the border and cross color of a recipient in mail
composer when the email is invalid (doesn't contains "@").
When sending an mail from composer the user will see easily
if an email adress is invalid and will cause a NO_VALID_RECIPIENT
error.
Task: #46158
PR: #24628
| -rw-r--r-- | addons/mail/static/src/xml/composer.xml | 11 | ||||
| -rw-r--r-- | addons/web/static/src/scss/fields.scss | 6 |
2 files changed, 15 insertions, 2 deletions
diff --git a/addons/mail/static/src/xml/composer.xml b/addons/mail/static/src/xml/composer.xml index bb9321a749d..d09b6bc4f22 100644 --- a/addons/mail/static/src/xml/composer.xml +++ b/addons/mail/static/src/xml/composer.xml @@ -79,8 +79,15 @@ </t> <t t-name="FieldMany2ManyTagsEmail" t-extend="FieldMany2ManyTag"> - <t t-jquery=".o_badge_text" t-operation="replace"> - <span class="o_badge_text" t-attf-title="#{el.email}"><t t-esc="el.display_name"/></span> + <t t-jquery="span[t-attf-class*=badge]" t-operation="replace"> + <t t-set="email_error" t-value="''"/> + <t t-if="el.email.indexOf('@') < 0"> + <t t-set="email_error" t-value="'o_tag_error'"/> + </t> + <span t-attf-class="badge dropdown o_tag_color_0 #{email_error}" t-att-data-color="color" t-att-data-index="el_index" t-att-data-id="el.id"> + <span class="o_badge_text" t-attf-title="#{el.email}"><t t-esc="el.display_name"/></span> + <span t-if="!readonly" class="fa fa-times o_delete"/> + </span> </t> </t> </templates> diff --git a/addons/web/static/src/scss/fields.scss b/addons/web/static/src/scss/fields.scss index 0fd69037b0b..2a35c33005a 100644 --- a/addons/web/static/src/scss/fields.scss +++ b/addons/web/static/src/scss/fields.scss @@ -173,6 +173,12 @@ } } } + } + > .o_tag_error{ + box-shadow: inset 0 0 0 2px #FF0000; + > .o_delete { + color: #FF0000; + } } } |
