diff --git a/addons/account/i18n/account.pot b/addons/account/i18n/account.pot index ecb3a843a78..617430fad62 100644 --- a/addons/account/i18n/account.pot +++ b/addons/account/i18n/account.pot @@ -1947,6 +1947,12 @@ msgstr "" msgid "Bank Statement" msgstr "" +#. module: account +#: code:addons/account/models/account_bank_statement.py:935 +#, python-format +msgid "Bank Statement %s" +msgstr "" + #. module: account #: model:ir.model,name:account.model_account_bank_statement_line msgid "Bank Statement Line" diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py index ae86ca440d3..46db7021f41 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -922,7 +922,7 @@ class AccountBankStatementLine(models.Model): 'currency_id': currency.id, 'amount': abs(total), 'communication': self._get_communication(payment_methods[0] if payment_methods else False), - 'name': self.statement_id.name, + 'name': self.statement_id.name or _("Bank Statement %s") % self.date, }) # Complete dicts to create both counterpart move lines and write-offs diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 87dfcc5aa24..3325b2d3b5a 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -1259,7 +1259,7 @@ class AccountMoveLine(models.Model): raise UserError(_('You cannot do this modification on a reconciled entry. You can just change some non legal fields or you must unreconcile first.\n%s.') % err_msg) if line.move_id.id not in move_ids: move_ids.add(line.move_id.id) - self.env['account.move'].browse(list(move_ids))._check_lock_date() + self.env['account.move'].browse(list(move_ids))._check_lock_date() return True #################################################### diff --git a/addons/calendar/models/calendar.py b/addons/calendar/models/calendar.py index b6245a6793d..6011c45a63f 100644 --- a/addons/calendar/models/calendar.py +++ b/addons/calendar/models/calendar.py @@ -853,8 +853,8 @@ class Meeting(models.Model): @api.multi def _compute_color_partner(self): - for meeting in self.sudo(): - meeting.color_partner_id = meeting.user_id.partner_id.id + for meeting in self: + meeting.color_partner_id = meeting.sudo().user_id.partner_id.id @api.constrains('start_datetime', 'stop_datetime', 'start_date', 'stop_date') def _check_closing_date(self): diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py index d142f69a870..9ffdc1110a4 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -506,19 +506,14 @@ class SaleOrder(models.Model): res = {} currency = self.currency_id or self.company_id.currency_id for line in self.order_line: - base_tax = 0 + price_reduce = line.price_unit * (1.0 - line.discount / 100.0) + taxes = line.tax_id.compute_all(price_reduce, quantity=line.product_uom_qty, product=line.product_id, partner=self.partner_shipping_id)['taxes'] for tax in line.tax_id: group = tax.tax_group_id res.setdefault(group, 0.0) - # FORWARD-PORT UP TO SAAS-17 - price_reduce = line.price_unit * (1.0 - line.discount / 100.0) - taxes = tax.compute_all(price_reduce + base_tax, quantity=line.product_uom_qty, - product=line.product_id, partner=self.partner_shipping_id)['taxes'] for t in taxes: - res[group] += t['amount'] - if tax.include_base_amount: - base_tax += tax.compute_all(price_reduce + base_tax, quantity=1, product=line.product_id, - partner=self.partner_shipping_id)['taxes'][0]['amount'] + if t['id'] == tax.id or t['id'] in tax.children_tax_ids.ids: + res[group] += t['amount'] res = sorted(res.items(), key=lambda l: l[0].sequence) res = map(lambda l: (l[0].name, l[1]), res) return res diff --git a/addons/stock/i18n/stock.pot b/addons/stock/i18n/stock.pot index 6b685bcb889..977c500a236 100644 --- a/addons/stock/i18n/stock.pot +++ b/addons/stock/i18n/stock.pot @@ -6527,6 +6527,12 @@ msgstr "" msgid "You cannot cancel a stock move that has been set to 'Done'." msgstr "" +#. module: stock +#: code:addons/stock/models/stock_inventory.py:103 +#, python-format +msgid "You cannot delete a validated inventory adjustement." +msgstr "" + #. module: stock #: code:addons/stock/models/stock_inventory.py:369 #, python-format diff --git a/addons/stock/models/stock_inventory.py b/addons/stock/models/stock_inventory.py index 283dc12ee5f..2f1b757960a 100644 --- a/addons/stock/models/stock_inventory.py +++ b/addons/stock/models/stock_inventory.py @@ -96,6 +96,13 @@ class Inventory(models.Model): else: self.total_qty = 0 + @api.multi + def unlink(self): + for inventory in self: + if inventory.state == 'done': + raise UserError(_('You cannot delete a validated inventory adjustement.')) + return super(Inventory, self).unlink() + @api.model def _selection_filter(self): """ Get the list of filter allowed according to the options checked diff --git a/addons/stock_account/models/product.py b/addons/stock_account/models/product.py index bb04c02903d..90287337c01 100644 --- a/addons/stock_account/models/product.py +++ b/addons/stock_account/models/product.py @@ -198,7 +198,6 @@ class ProductProduct(models.Model): ] return [] - @api.model def _get_anglo_saxon_price_unit(self, uom=False): price = self.standard_price if not self or not uom or self.uom_id.id == uom.id: diff --git a/addons/stock_landed_costs/models/stock_landed_cost.py b/addons/stock_landed_costs/models/stock_landed_cost.py index 43c125415cf..a1223d896c8 100644 --- a/addons/stock_landed_costs/models/stock_landed_cost.py +++ b/addons/stock_landed_costs/models/stock_landed_cost.py @@ -282,13 +282,12 @@ class AdjustmentLines(models.Model): product_id = fields.Many2one('product.product', 'Product', required=True) quantity = fields.Float( 'Quantity', default=1.0, - digits=dp.get_precision('Product Unit of Measure'), required=True) + digits=0, required=True) weight = fields.Float( 'Weight', default=1.0, - digits=dp.get_precision('Product Unit of Measure')) + digits=dp.get_precision('Stock Weight')) volume = fields.Float( - 'Volume', default=1.0, - digits=dp.get_precision('Product Unit of Measure')) + 'Volume', default=1.0) former_cost = fields.Float( 'Former Cost', digits=dp.get_precision('Product Price')) former_cost_per_unit = fields.Float( diff --git a/addons/web_editor/static/src/js/backend.js b/addons/web_editor/static/src/js/backend.js index 23505c082fa..b160e6a7e97 100644 --- a/addons/web_editor/static/src/js/backend.js +++ b/addons/web_editor/static/src/js/backend.js @@ -194,7 +194,8 @@ var FieldTextHtml = widget.extend({ }, start: function () { var self = this; - + // Do not Forward port in >= 11.0 + this.$formButtons = this.getParent().$buttons; this.callback = _.uniqueId('FieldTextHtml_'); window.odoo[this.callback+"_editor"] = function (EditorBar) { setTimeout(function () { @@ -297,7 +298,8 @@ var FieldTextHtml = widget.extend({ this.$el.closest('.modal-body').css('max-height', 'none'); this.$iframe = this.$el.find('iframe'); // deactivate any button to avoid saving a not ready iframe - $('.o_cp_buttons, .o_statusbar_buttons').find('button').addClass('o_disabled').attr('disabled', true); + // Do not Forward port in >= 11.0 + this.$formButtons.find('button').addClass('o_disabled').attr('disabled', true); this.document = null; this.$body = $(); this.$content = $(); @@ -324,7 +326,8 @@ var FieldTextHtml = widget.extend({ this._dirty_flag = false; this.render_value(); // reactivate all the buttons when the field's content (the iframe) is loaded - $('.o_cp_buttons, .o_statusbar_buttons').find('button').removeClass('o_disabled').attr('disabled', false); + // Do not Forward port in >= 11.0 + this.$formButtons.find('button').removeClass('o_disabled').attr('disabled', false); setTimeout(function () { self.add_button(); setTimeout(self.resize,0); @@ -422,6 +425,8 @@ var FieldTextHtml = widget.extend({ } }, destroy: function () { + // Do not Forward port in >= 11.0 + this.$formButtons.find('button').removeClass('o_disabled').attr('disabled', false); $(window).off('resize', this.resize); delete window.odoo[this.callback+"_editor"]; delete window.odoo[this.callback+"_content"];