summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabien Pinckaers <fp@tinyerp.com>2011-09-17 14:55:37 +0200
committerFabien Pinckaers <fp@tinyerp.com>2011-09-17 14:55:37 +0200
commita2dbd69cd60d6449f7fd2b34f3b48b33a29f4b17 (patch)
treeed2bdc8fb6121b4ab67a476179eac112fa8622b7
parent4cf189a0a734f05b9cfeb863faa0cdefe256470a (diff)
[FIX]
lp bug: https://launchpad.net/bugs/781585 fixed bzr revid: fp@tinyerp.com-20110917125537-y32aedueqdu7pc9o
-rw-r--r--addons/account/account.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/addons/account/account.py b/addons/account/account.py
index 57b3310a933..25618d8886f 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -2133,7 +2133,11 @@ class account_model(osv.osv):
period_id = period_id[0]
for model in self.browse(cr, uid, ids, context=context):
- entry['name'] = model.name%{'year':time.strftime('%Y'), 'month':time.strftime('%m'), 'date':time.strftime('%Y-%m')}
+ try:
+ entry['name'] = model.name%{'year':time.strftime('%Y'), 'month':time.strftime('%m'), 'date':time.strftime('%Y-%m')}
+ except:
+ raise osv.except_osv(_('Wrong model !'), _('You have a wrong expression "%(...)s" in your model !'))
+
move_id = account_move_obj.create(cr, uid, {
'ref': entry['name'],
'period_id': period_id,
@@ -2205,8 +2209,8 @@ class account_model_line(osv.osv):
}
_order = 'sequence'
_sql_constraints = [
- ('credit_debit1', 'CHECK (credit*debit=0)', 'Wrong credit or debit value in model (Credit Or Debit Must Be "0")!'),
- ('credit_debit2', 'CHECK (credit+debit>=0)', 'Wrong credit or debit value in model (Credit + Debit Must Be greater "0")!'),
+ ('credit_debit1', 'CHECK (credit*debit=0)', 'Wrong credit or debit value in model, they must be positive!'),
+ ('credit_debit2', 'CHECK (credit+debit>=0)', 'Wrong credit or debit value in model, they must be positive!'),
]
account_model_line()