[FIX] crm: fix UserError message while merging leads

This commit fixes the UserError message by properly displaying the
number of maximum leads that can be merged.

Apart from that, this commit also hides 'email_from' and 'phone' fields
on merge wizard to avoid scroll and to make sure that the 'x' icon is
always visible, which previously was far right and user had to scroll
a bit for removing the lines with that button.

TaskID-2542260

closes odoo/odoo#71523

X-original-commit: abbf3419767c149f338a4a48f15c2af7dfbed2bc
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
dht-odoo
2021-06-01 09:00:39 +00:00
parent a6e7c41d5e
commit e33ef69e7d
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -1335,7 +1335,7 @@ class Lead(models.Model):
raise UserError(_('Please select more than one element (lead or opportunity) from the list view.'))
if max_length and len(self.ids) > max_length and not self.env.is_superuser():
raise UserError(_("To prevent data loss, Leads and Opportunities can only be merged by groups of %(max_length)s."))
raise UserError(_("To prevent data loss, Leads and Opportunities can only be merged by groups of %(max_length)s.", max_length=max_length))
opportunities = self._sort_by_confidence_level(reverse=True)
@@ -17,8 +17,8 @@
<field name="name"/>
<field name="type"/>
<field name="contact_name"/>
<field name="email_from"/>
<field name="phone" class="o_force_ltr"/>
<field name="email_from" optional="hide"/>
<field name="phone" class="o_force_ltr" optional="hide"/>
<field name="stage_id"/>
<field name="user_id"/>
<field name="team_id"/>