diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 23a60c1423c..29bd05b70ad 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -515,12 +515,13 @@ class AccountMoveLine(models.Model): #compute the default credit/debit of the next line in case of a manual entry balance = 0 - for line in self._context['line_ids']: - if line[2]: # in case of command 0: add a record with values - balance += line[2].get('debit', 0) - line[2].get('credit', 0) - elif line[0] == 2: # line has been deleted - line_obj = self.browse(line[1]) - balance -= line_obj.debit - line_obj.credit + for line in self.move_id.resolve_2many_commands( + 'line_ids', self._context['line_ids'], fields=['credit', 'debit']): + balance += line.get('debit', 0) - line.get('credit', 0) + # if we are here, line_ids is in context, so journal_id should also be. + currency = self._context.get('journal_id') and self.browse(self._context['journal_id']).company_id.currency_id + if currency: + balance = currency.round(balance) if balance < 0: rec.update({'debit': -balance}) if balance > 0: diff --git a/addons/im_livechat/controllers/main.py b/addons/im_livechat/controllers/main.py index 79a5f28b99b..381874903b9 100644 --- a/addons/im_livechat/controllers/main.py +++ b/addons/im_livechat/controllers/main.py @@ -80,7 +80,6 @@ class LivechatController(http.Controller): @http.route('/im_livechat/feedback', type='json', auth='public') def feedback(self, uuid, rate, reason=None, **kwargs): Channel = request.env['mail.channel'] - Rating = request.env['rating.rating'] channel = Channel.sudo().search([('uuid', '=', uuid)], limit=1) if channel: # limit the creation : only ONE rating per session @@ -101,7 +100,11 @@ class LivechatController(http.Controller): # if logged in user, set its partner on rating values['partner_id'] = request.env.user.partner_id.id if request.session.uid else False # create the rating - rating = Rating.sudo().create(values) + + channel.write({ + 'rating_ids': [(0, False, values)] + }) + rating = channel.rating_ids[0] else: rating = channel.rating_ids[0] rating.write(values) diff --git a/addons/l10n_uk/__manifest__.py b/addons/l10n_uk/__manifest__.py index e35c1478840..b1765ff6f6c 100644 --- a/addons/l10n_uk/__manifest__.py +++ b/addons/l10n_uk/__manifest__.py @@ -15,7 +15,7 @@ This is the latest UK Odoo localisation necessary to run Odoo accounting for UK - InfoLogic UK counties listing - a few other adaptations""", 'author': 'SmartMode LTD', - 'website': 'http://www.smartmode.co.uk', + 'website': 'https://www.odoo.com/page/accounting', 'depends': [ 'account', 'base_iban', diff --git a/addons/purchase/models/purchase.py b/addons/purchase/models/purchase.py index 5697ce004c9..e591b9a20a0 100644 --- a/addons/purchase/models/purchase.py +++ b/addons/purchase/models/purchase.py @@ -699,6 +699,12 @@ class PurchaseOrderLine(models.Model): if move.location_dest_id.usage == "supplier": if move.to_refund: total -= move.product_uom._compute_quantity(move.product_uom_qty, line.product_uom) + elif move.origin_returned_move_id._is_dropshipped() and not move._is_dropshipped_returned(): + # Edge case: the dropship is returned to the stock, no to the supplier. + # In this case, the received quantity on the PO is set although we didn't + # receive the product physically in our stock. To avoid counting the + # quantity twice, we do nothing. + pass else: total += move.product_uom._compute_quantity(move.product_uom_qty, line.product_uom) line.qty_received = total diff --git a/addons/web/static/src/js/core/utils.js b/addons/web/static/src/js/core/utils.js index ffeb4a1de87..18fa99097ce 100644 --- a/addons/web/static/src/js/core/utils.js +++ b/addons/web/static/src/js/core/utils.js @@ -324,7 +324,7 @@ var utils = { } var normalized_value = value / precision; var epsilon_magnitude = Math.log(Math.abs(normalized_value))/Math.log(2); - var epsilon = Math.pow(2, epsilon_magnitude - 53); + var epsilon = Math.pow(2, epsilon_magnitude - 52); normalized_value += normalized_value >= 0 ? epsilon : -epsilon; /** diff --git a/addons/web_editor/static/src/js/editor/summernote.js b/addons/web_editor/static/src/js/editor/summernote.js index f3d895c1b76..e67bf160e53 100644 --- a/addons/web_editor/static/src/js/editor/summernote.js +++ b/addons/web_editor/static/src/js/editor/summernote.js @@ -2095,14 +2095,16 @@ $.summernote.pluginEvents.applyFont = function (event, editor, layoutInfo, color } // apply font: foreColor, backColor, size (the color can be use a class text-... or bg-...) - var font, $font, fonts = [], className; + var ancestors, font, $font, fonts = [], className; var i; if (color || bgcolor || size) { for (i=0; i