summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-06-19 12:07:56 +0200
committerChristophe Simonis <chs@odoo.com>2019-06-19 12:07:56 +0200
commit132e38beeffc97c30d79eae1f18836e8117fc45e (patch)
tree5be367853e4e2570719df9437f1f022c0855813c /addons
parent8a19a6a2a34d318d2c5b799a0e8e108fe04a097c (diff)
parentb5a04fd29ff19839e788b2c383e3af74c883c54d (diff)
[MERGE] forward port branch 11.0 up to b5a04fd29ff
Diffstat (limited to 'addons')
-rw-r--r--addons/mail/models/mail_activity.py5
-rw-r--r--addons/mail/models/mail_message.py10
-rw-r--r--addons/product/report/product_pricelist.py3
-rw-r--r--addons/website_mail/models/mail_message.py5
-rw-r--r--addons/website_sale_comparison/static/src/js/website_sale_comparison.js11
5 files changed, 25 insertions, 9 deletions
diff --git a/addons/mail/models/mail_activity.py b/addons/mail/models/mail_activity.py
index 5b1306dc11d..4f5b5415728 100644
--- a/addons/mail/models/mail_activity.py
+++ b/addons/mail/models/mail_activity.py
@@ -191,8 +191,9 @@ class MailActivity(models.Model):
self.env[model].browse(res_ids).check_access_rule(doc_operation)
except exceptions.AccessError:
raise exceptions.AccessError(
- _('The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\n\n(Document type: %s, Operation: %s)') %
- (self._description, operation))
+ _('The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\n\n(Document type: %s, Operation: %s)') % (self._description, operation)
+ + ' - ({} {}, {} {})'.format(_('Records:'), res_ids[:6], _('User:'), self._uid)
+ )
@api.model
def create(self, values):
diff --git a/addons/mail/models/mail_message.py b/addons/mail/models/mail_message.py
index 97a2b729d83..9b9ece2888c 100644
--- a/addons/mail/models/mail_message.py
+++ b/addons/mail/models/mail_message.py
@@ -591,8 +591,9 @@ class Message(models.Model):
WHERE message.message_type = %%s AND (message.subtype_id IS NULL OR subtype.internal IS TRUE) AND message.id = ANY (%%s)''' % (self._table), ('comment', self.ids,))
if self._cr.fetchall():
raise AccessError(
- _('The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\n\n(Document type: %s, Operation: %s)') %
- (self._description, operation))
+ _('The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\n\n(Document type: %s, Operation: %s)') % (self._description, operation)
+ + ' - ({} {}, {} {})'.format(_('Records:'), self.ids[:6], _('User:'), self._uid)
+ )
# Read mail_message.ids to have their values
message_values = dict((res_id, {}) for res_id in self.ids)
@@ -691,8 +692,9 @@ class Message(models.Model):
if not (other_ids and self.browse(other_ids).exists()):
return
raise AccessError(
- _('The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\n\n(Document type: %s, Operation: %s)') %
- (self._description, operation))
+ _('The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\n\n(Document type: %s, Operation: %s)') % (self._description, operation)
+ + ' - ({} {}, {} {})'.format(_('Records:'), list(other_ids)[:6], _('User:'), self._uid)
+ )
@api.model
def _get_record_name(self, values):
diff --git a/addons/product/report/product_pricelist.py b/addons/product/report/product_pricelist.py
index c0bd5138fab..8a82ceb70ab 100644
--- a/addons/product/report/product_pricelist.py
+++ b/addons/product/report/product_pricelist.py
@@ -27,7 +27,8 @@ class report_product_pricelist(models.AbstractModel):
}
def _get_quantity(self, data):
- return sorted([data['form'][key] for key in data['form'] if key.startswith('qty') and data['form'][key]])
+ form = data and data.get('form') or {}
+ return sorted([form[key] for key in form if key.startswith('qty') and form[key]])
def _get_categories(self, pricelist, products, quantities):
categ_data = []
diff --git a/addons/website_mail/models/mail_message.py b/addons/website_mail/models/mail_message.py
index 34609160f1d..fa427c03c53 100644
--- a/addons/website_mail/models/mail_message.py
+++ b/addons/website_mail/models/mail_message.py
@@ -54,7 +54,10 @@ class MailMessage(models.Model):
if self.user_has_groups('base.group_public'):
self.env.cr.execute('SELECT id FROM "%s" WHERE website_published IS FALSE AND id = ANY (%%s)' % (self._table), (self.ids,))
if self.env.cr.fetchall():
- raise AccessError(_('The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\n\n(Document type: %s, Operation: %s)') % (self._description, operation))
+ raise AccessError(
+ _('The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\n\n(Document type: %s, Operation: %s)') % (self._description, operation)
+ + ' - ({} {}, {} {})'.format(_('Records:'), self.ids[:6], _('User:'), self._uid)
+ )
return super(MailMessage, self).check_access_rule(operation=operation)
@api.multi
diff --git a/addons/website_sale_comparison/static/src/js/website_sale_comparison.js b/addons/website_sale_comparison/static/src/js/website_sale_comparison.js
index 9d27a98d558..59dcd2ee372 100644
--- a/addons/website_sale_comparison/static/src/js/website_sale_comparison.js
+++ b/addons/website_sale_comparison/static/src/js/website_sale_comparison.js
@@ -3,6 +3,7 @@ odoo.define('website_sale_comparison.comparison', function (require) {
require('web.dom_ready');
var ajax = require('web.ajax');
+var concurrency = require('web.concurrency');
var core = require('web.core');
var _t = core._t;
var utils = require('web.utils');
@@ -26,6 +27,7 @@ var ProductComparison = Widget.extend({
init: function(){
this.comparelist_product_ids = JSON.parse(utils.get_cookie('comparelist_product_ids') || '[]');
this.product_compare_limit = 4;
+ this.guard = new concurrency.Mutex();
},
start:function(){
var self = this;
@@ -113,6 +115,9 @@ var ProductComparison = Widget.extend({
}
},
add_new_products:function(product_id){
+ this.guard.exec(this._add_new_products.bind(this, product_id));
+ },
+ _add_new_products: function (product_id) {
var self = this;
$('.o_product_feature_panel').show();
if (!_.contains(self.comparelist_product_ids, product_id)) {
@@ -120,8 +125,9 @@ var ProductComparison = Widget.extend({
if(_.has(self.product_data, product_id)){
self.update_content([product_id], false);
} else {
- self.load_products([product_id]).then(function(){
+ return self.load_products([product_id]).then(function () {
self.update_content([product_id], false);
+ self.update_cookie();
});
}
}
@@ -139,6 +145,9 @@ var ProductComparison = Widget.extend({
this.refresh_panel();
},
rm_from_comparelist: function(e){
+ this.guard.exec(this._rm_from_comparelist.bind(this, e));
+ },
+ _rm_from_comparelist: function (e) {
this.comparelist_product_ids = _.without(this.comparelist_product_ids, $(e.currentTarget).data('product_product_id'));
$(e.currentTarget).parents('.o_product_row').remove();
this.update_cookie();