diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-08-21 16:58:16 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-08-21 16:58:16 +0200 |
| commit | 668c360e32b4130966eddc8ed28b6cb4e66055aa (patch) | |
| tree | 0e50e6458998b2e4ad029341600655586eb14929 /addons | |
| parent | 121034f79a6a4e57ed936c8672fc5f8472ca2cfd (diff) | |
| parent | 1b234b1be75e32f741b3e236a89ea854f0c186a5 (diff) | |
[MERGE] forward port branch 11.0 up to 1b234b1be75
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/account/models/account_move.py | 13 | ||||
| -rw-r--r-- | addons/im_livechat/controllers/main.py | 7 | ||||
| -rw-r--r-- | addons/l10n_uk/__manifest__.py | 2 | ||||
| -rw-r--r-- | addons/purchase/models/purchase.py | 6 | ||||
| -rw-r--r-- | addons/web/static/src/js/core/utils.js | 2 | ||||
| -rw-r--r-- | addons/web_editor/static/src/js/editor/summernote.js | 8 | ||||
| -rw-r--r-- | addons/website_sale_comparison/models/website_sale_comparison.py | 2 |
7 files changed, 26 insertions, 14 deletions
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<nodes.length; i++) { node = nodes[i]; - font = dom.ancestor(node, dom.isFont); - if (!font) { + ancestors = dom.listAncestor(node, dom.isFont); + font = ancestors.slice(-1)[0]; + // add font if node is not inside a font or inside an anchor firstly + if (!dom.isFont(font) || ancestors.filter(dom.isAnchor).length) { if (node.textContent.match(/^[ ]|[ ]$/)) { node.textContent = node.textContent.replace(/^[ ]|[ ]$/g, '\u00A0'); } diff --git a/addons/website_sale_comparison/models/website_sale_comparison.py b/addons/website_sale_comparison/models/website_sale_comparison.py index 88be2499c0a..a03da2638f0 100644 --- a/addons/website_sale_comparison/models/website_sale_comparison.py +++ b/addons/website_sale_comparison/models/website_sale_comparison.py @@ -9,7 +9,7 @@ class ProductAttributeCategory(models.Model): _description = "Product Attribute Category" _order = 'sequence' - name = fields.Char("Category Name", required=True) + name = fields.Char("Category Name", required=True, translate=True) sequence = fields.Integer("Sequence", default=10) |
