diff options
| author | P. Christeas <p_christ@hol.gr> | 2010-11-18 18:47:21 +0200 |
|---|---|---|
| committer | P. Christeas <p_christ@hol.gr> | 2010-11-18 18:47:21 +0200 |
| commit | c8f52b8c98775e98657600bfc3a559960c500be9 (patch) | |
| tree | e5423bef8c9dbc6a644f1a031dac8c93eb975452 /bin/addons/base/module/module.py | |
| parent | 1f380f050417c247e40f2f29d14d6c1fbd80360e (diff) | |
ORM, ir_*: convert standard constraint messages to callables
Also, fix way that callable constraints are passed with the context so
that they can have translatable strings inside (but not on the results
of the callable).
Conflicts:
bin/addons/base/ir/ir_model.py
bin/addons/base/module/module.py
bin/tools/translate.py
bzr revid: p_christ@hol.gr-20101118164721-19rgx43d3p96b2lf
Diffstat (limited to 'bin/addons/base/module/module.py')
| -rw-r--r-- | bin/addons/base/module/module.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bin/addons/base/module/module.py b/bin/addons/base/module/module.py index 81985332157..f392ee51326 100644 --- a/bin/addons/base/module/module.py +++ b/bin/addons/base/module/module.py @@ -187,9 +187,14 @@ class module(osv.osv): } _order = 'name' + def _name_uniq_msg(self, cr, uid, ids, context=None): + return _('The name of the module must be unique !') + def _certificate_uniq_msg(self, cr, uid, ids, context=None): + return _('The certificate ID of the module must be unique !') + _sql_constraints = [ - ('name_uniq', 'unique (name)', 'The name of the module must be unique !'), - ('certificate_uniq', 'unique (certificate)', 'The certificate ID of the module must be unique !') + ('name_uniq', 'UNIQUE (name)',_name_uniq_msg ), + ('certificate_uniq', 'UNIQUE (certificate)',_certificate_uniq_msg ) ] def unlink(self, cr, uid, ids, context=None): |
