diff --git a/addons/account/i18n/account.pot b/addons/account/i18n/account.pot index 826ee73d23c..678b7841529 100644 --- a/addons/account/i18n/account.pot +++ b/addons/account/i18n/account.pot @@ -2143,6 +2143,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 c3a37ebf979..dbe70076c42 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -934,7 +934,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 796974adade..727bdf298ae 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -1361,7 +1361,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/sale/models/sale.py b/addons/sale/models/sale.py index 6667725505a..5b384329a20 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -585,7 +585,6 @@ class SaleOrder(models.Model): for tax in line.tax_id: group = tax.tax_group_id res.setdefault(group, {'amount': 0.0, 'base': 0.0}) - # FORWARD-PORT UP TO SAAS-17 for t in taxes: if t['id'] == tax.id or t['id'] in tax.children_tax_ids.ids: res[group]['amount'] += t['amount'] diff --git a/addons/stock/i18n/stock.pot b/addons/stock/i18n/stock.pot index 9a097a5e07e..5b13fc1578f 100644 --- a/addons/stock/i18n/stock.pot +++ b/addons/stock/i18n/stock.pot @@ -6756,6 +6756,12 @@ msgstr "" msgid "You cannot delete a scrap which is 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:386 #, python-format diff --git a/addons/stock/models/stock_inventory.py b/addons/stock/models/stock_inventory.py index b192ca775af..1f10a4940f6 100644 --- a/addons/stock/models/stock_inventory.py +++ b/addons/stock/models/stock_inventory.py @@ -97,6 +97,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 f7da7005ef5..ebb68168250 100644 --- a/addons/stock_account/models/product.py +++ b/addons/stock_account/models/product.py @@ -254,7 +254,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 49ff9488376..a4a73ef79c8 100644 --- a/addons/stock_landed_costs/models/stock_landed_cost.py +++ b/addons/stock_landed_costs/models/stock_landed_cost.py @@ -261,13 +261,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(