summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorFlorent de Labarre <florent.mirieu@gmail.com>2017-09-14 03:59:24 -0400
committerqdp-odoo <qdp@odoo.com>2017-09-14 09:59:24 +0200
commit93d4da977a2ad41dd0547977f3faace55df2cc76 (patch)
tree5b16f1fc66d82013316c2fc085dda0868129c5be /addons
parente390b0d64091237e42673abf1510d99906c398bc (diff)
[IMP] account: improve error message raised
Add the code/name of deprecated account on the error message when it is used. Was PR #19392. Courtesy of Florent de Labarre
Diffstat (limited to 'addons')
-rw-r--r--addons/account/models/account_move.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py
index c5592413983..87cc5f3d470 100644
--- a/addons/account/models/account_move.py
+++ b/addons/account/models/account_move.py
@@ -1166,7 +1166,7 @@ class AccountMoveLine(models.Model):
move = self.env['account.move'].browse(vals['move_id'])
account = self.env['account.account'].browse(vals['account_id'])
if account.deprecated:
- raise UserError(_('You cannot use deprecated account.'))
+ raise UserError(_('The account %s (%s) is deprecated !') %(account.name, account.code))
if 'journal_id' in vals and vals['journal_id']:
context['journal_id'] = vals['journal_id']
if 'date' in vals and vals['date']: