diff --git a/addons/product/report/product_pricelist.py b/addons/product/report/product_pricelist.py index e6ccde44d8eb09f1385e80b2271d02e0a546701d..abdb705c52998c212601c827a6d2061906927796 100644 --- a/addons/product/report/product_pricelist.py +++ b/addons/product/report/product_pricelist.py @@ -28,7 +28,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_sale_comparison/static/src/js/website_sale_comparison.js b/addons/website_sale_comparison/static/src/js/website_sale_comparison.js index a52d548cb777603251e4f68a51e022d85a90b8aa..45b2b60d8e6de3e2fb5565f0f8aa9c4fce4324ab 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 @@ -1,6 +1,7 @@ odoo.define('website_sale_comparison.comparison', function (require) { 'use strict'; +var concurrency = require('web.concurrency'); var core = require('web.core'); var utils = require('web.utils'); var Widget = require('web.Widget'); @@ -31,6 +32,7 @@ var ProductComparison = Widget.extend(ProductConfiguratorMixin, { this.product_data = {}; this.comparelist_product_ids = JSON.parse(utils.get_cookie('comparelist_product_ids') || '[]'); this.product_compare_limit = 4; + this.guard = new concurrency.Mutex(); }, /** * @override @@ -157,6 +159,9 @@ var ProductComparison = Widget.extend(ProductConfiguratorMixin, { * @private */ _addNewProducts: function (product_id) { + this.guard.exec(this._addNewProductsImpl.bind(this, product_id)); + }, + _addNewProductsImpl: function (product_id) { var self = this; $('.o_product_feature_panel').addClass('d-md-block'); if (!_.contains(self.comparelist_product_ids, product_id)) { @@ -164,8 +169,9 @@ var ProductComparison = Widget.extend(ProductConfiguratorMixin, { if (_.has(self.product_data, product_id)){ self._updateContent(); } else { - self._loadProducts([product_id]).then(function () { + return self._loadProducts([product_id]).then(function () { self._updateContent(); + self._updateCookie(); }); } } @@ -192,6 +198,9 @@ var ProductComparison = Widget.extend(ProductConfiguratorMixin, { * @private */ _removeFromComparelist: function (e) { + this.guard.exec(this._removeFromComparelistImpl.bind(this, e)); + }, + _removeFromComparelistImpl: 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._updateCookie(); diff --git a/odoo/addons/base/data/res_currency_data.xml b/odoo/addons/base/data/res_currency_data.xml index 02e933c3f40694a2550f6be9f556fecd7a0c268e..3ff94812022f63e9594c5d6a77e8d634b0a97a8f 100644 --- a/odoo/addons/base/data/res_currency_data.xml +++ b/odoo/addons/base/data/res_currency_data.xml @@ -222,6 +222,7 @@ <field name="symbol">Â¥</field> <field name="rounding">1.00</field> <field name="active" eval="False"/> + <field name="position">before</field> <field name="currency_unit_label">Yen</field> <field name="currency_subunit_label">Cen</field> </record> diff --git a/odoo/addons/base/models/ir_actions.py b/odoo/addons/base/models/ir_actions.py index 6d84e6f1381968aa5a8a82fdc7a37d6517b28f91..d67a1098a51f663eef3dfe85c1f47563b752ecda 100644 --- a/odoo/addons/base/models/ir_actions.py +++ b/odoo/addons/base/models/ir_actions.py @@ -248,7 +248,10 @@ class IrActionsActWindow(models.Model): existing = self.filtered(lambda rec: rec.id in ids) if len(existing) < len(self): # mark missing records in cache with a failed value - exc = MissingError(_("Record does not exist or has been deleted.")) + exc = MissingError( + _("Record does not exist or has been deleted.") + + '\n\n({} {}, {} {})'.format(_('Records:'), (self - existing).ids[:6], _('User:'), self._uid) + ) for record in (self - existing): record._cache.set_failed(self._fields, exc) return existing diff --git a/odoo/addons/base/models/ir_model.py b/odoo/addons/base/models/ir_model.py index bac517908a5b8168df2c728ce9a15bf92c955131..a7c66ae773da3ac327c684ef60939776adb0a1b4 100644 --- a/odoo/addons/base/models/ir_model.py +++ b/odoo/addons/base/models/ir_model.py @@ -1267,6 +1267,7 @@ class IrModelAccess(models.Model): else: msg_tail = _("Please contact your system administrator if you think this is an error.") + "\n\n(" + _("Document model") + ": %s)" msg_params = (model,) + msg_tail += ' - ({} {}, {} {})'.format(_('Operation:'), mode, _('User:'), self._uid) _logger.info('Access Denied by ACLs for operation: %s, uid: %s, model: %s', mode, self._uid, model) msg = '%s %s' % (msg_heads[mode], msg_tail) raise AccessError(msg % msg_params)