summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2017-05-08 17:57:06 +0200
committerThibault Delavallée <tde@odoo.com>2017-05-09 09:31:11 +0200
commit16884487e7bbe6d29fc6a61e5b181af99613f35b (patch)
tree46b1d64ec55efcbc31f8a41727e88c0c6df60759
parent8d9f0c8d941565f3831adef4c12b94cb97ed8be9 (diff)
[FIX] website_form: do not subscribe administrator to all records from website form
As administrator is used to create all records from website form he is also put into followers. This creates a lot of unnecessary notifications and/or emails depending on the system configuration. Using the magic context key this behavior is modified. Administrator will not follow every records created through the website form anymore.
-rw-r--r--addons/website_form/controllers/main.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/website_form/controllers/main.py b/addons/website_form/controllers/main.py
index 742a8eeb0b7..f0ef484f1a9 100644
--- a/addons/website_form/controllers/main.py
+++ b/addons/website_form/controllers/main.py
@@ -170,7 +170,7 @@ class WebsiteForm(http.Controller):
return data
def insert_record(self, request, model, values, custom, meta=None):
- record = request.env[model.model].sudo().create(values)
+ record = request.env[model.model].sudo().with_context(mail_create_nosubscribe=True).create(values)
if custom or meta:
default_field = model.website_form_default_field_id