diff options
| author | nounoubensebia <neb@odoo.com> | 2021-04-22 15:01:26 +0000 |
|---|---|---|
| committer | nounoubensebia <neb@odoo.com> | 2021-05-05 13:01:08 +0000 |
| commit | 1688265fe2f79385e7171b257489ae103288beee (patch) | |
| tree | 41ebd9db1b9394933888a6f48c7d98591068a676 /addons | |
| parent | ac3e0fcd32d66d6e0bacfabd2d224805d92dbfd1 (diff) | |
[FIX] mail: display default name for followers for "other address" partner
Display the default name (the one displayed in the kanban view) for followers replacing
the False value for "other address" partners, this way the user won't get
confused, furthermore, this fix won't require the name to be mandatory for this
type of contacts.
Task-2514244
closes odoo/odoo#70391
X-original-commit: 4c1271738daa039e79a11646fef3f4264e4d96d2
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/mail/controllers/main.py | 1 | ||||
| -rw-r--r-- | addons/mail/static/src/components/follower/follower.xml | 2 | ||||
| -rw-r--r-- | addons/mail/static/src/models/follower/follower.js | 4 |
3 files changed, 6 insertions, 1 deletions
diff --git a/addons/mail/controllers/main.py b/addons/mail/controllers/main.py index bf3f268f68b..4ecd87d3d71 100644 --- a/addons/mail/controllers/main.py +++ b/addons/mail/controllers/main.py @@ -143,6 +143,7 @@ class MailController(http.Controller): 'partner_id': follower.partner_id.id, 'channel_id': follower.channel_id.id, 'name': follower.name, + 'display_name': follower.display_name, 'email': follower.email, 'is_active': follower.is_active, # When editing the followers, the "pencil" icon that leads to the edition of subtypes diff --git a/addons/mail/static/src/components/follower/follower.xml b/addons/mail/static/src/components/follower/follower.xml index 26a26ece3f9..5cdc89d7c96 100644 --- a/addons/mail/static/src/components/follower/follower.xml +++ b/addons/mail/static/src/components/follower/follower.xml @@ -6,7 +6,7 @@ <t t-if="follower"> <a class="o_Follower_details" t-att-class="{ 'o-inactive': !follower.isActive }" href="#" t-on-click="_onClickDetails"> <img class="o_Follower_avatar" t-attf-src="/web/image/{{ follower.resModel }}/{{ follower.resId }}/image_128" alt="Avatar"/> - <span class="o_Follower_name" t-esc="follower.name"/> + <span class="o_Follower_name" t-esc="follower.name or follower.displayName"/> </a> <t t-if="follower.isEditable"> <button class="btn btn-icon o_Follower_button o_Follower_editButton" title="Edit subscription" t-on-click="_onClickEdit"> diff --git a/addons/mail/static/src/models/follower/follower.js b/addons/mail/static/src/models/follower/follower.js index dec44da46ce..493fe836515 100644 --- a/addons/mail/static/src/models/follower/follower.js +++ b/addons/mail/static/src/models/follower/follower.js @@ -45,6 +45,7 @@ function factory(dependencies) { data2.partner = [['unlink-all']]; } else { const partnerData = { + display_name: data.display_name, email: data.email, id: data.partner_id, name: data.name, @@ -240,6 +241,9 @@ function factory(dependencies) { channelName: attr({ related: 'channel.name', }), + displayName: attr({ + related: 'partner.display_name' + }), followedThread: many2one('mail.thread', { inverse: 'followers', }), |
