summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic/basic_controller.js
diff options
context:
space:
mode:
authorThibault Francois <tfr@openerp.com>2020-01-23 15:39:57 +0000
committerThibault Francois <tfr@openerp.com>2020-02-14 10:40:57 +0000
commit8c1c7f26876eac8a431ef12fe373298fd01ce241 (patch)
treead12a749705e5c8b912b0cd577b96935835c2b41 /addons/web/static/src/js/views/basic/basic_controller.js
parent7639f7fbcb7578ca77509c656737747904b1b927 (diff)
[FIX] mail: Don't create duplicate mail.notification
When more than one user are linked to the same res.partner and this user is assigned to a task or a sale.order as many email notifications will be created as there are users linked to the same res.partner. This won't send more than 1 email, but multiple mail.notification records will be created. This causes duplicate entries in the mail.notification table, and can crash when an old unique constraint is still present in that table (from earlier Odoo versions) To prevent this, we deduplicate the notifications and order by notification type to get 'email' first in case the user have different notification type ('email', 'inbox'). How to reproduce: - Create a first user test1 - Create a second user test2 - Merge the contact test1 and test2 - Create a customer customer - Set the user test1 as salesman - Create a new sale.order with customer as partner Add a test to reproduce the pathological scenario Solution add distinct on partner.id and order by partner.id, users.notification_type closes odoo/odoo#45386 X-original-commit: 00f36c60e4790c8f5341cbc4f2c67e22e6d68f87 Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_controller.js')
0 files changed, 0 insertions, 0 deletions