Add translation of _constraints

This commit is contained in:
Cédric Krier committed 2008-08-05 11:35:35 +02:00
1 parent 9a39460626
commit 93cef8c954
2 files changed
+14 -7

No files matched your search

+9 -5
View File
@@ -62,9 +62,11 @@ class Account(OSV):
def __init__(self):
super(Account, self).__init__()
self._constraints += [
('check_recursion',
'Error! You can not create recursive account.', ['parent']),
('check_recursion', 'recursive_accounts'),
]
self._error_messages.update({
'recursive_accounts': 'You can not create recursive accounts!',
})
self._order.insert(0, ('code', 'ASC'))
def default_active(self, cursor, user, context=None):
@@ -367,10 +369,12 @@ class AccountSelection(OSV):
def __init__(self):
super(AccountSelection, self).__init__()
self._constraints += [
('check_root', 'Can not have many accounts with the same root ' \
'or a missing mandatory root account!',
['accounts']),
('check_root', 'root_account'),
]
self._error_messages.update({
'root_account': 'Can not have many accounts with the same root ' \
'or a missing mandatory root account!',
})
def check_root(self, cursor, user, ids):
"Check Root"
+5 -2
View File
@@ -34,9 +34,12 @@ class Line(OSV):
'Wrong credit/debit values!'),
]
self._constraints += [
('check_account', 'You can not create move line \n' \
'on view/inactive account!', ['account']),
('check_account', 'line_on_view_inactive_account'),
]
self._error_messages.update({
'line_on_view_inactive_account': 'You can not create move line\n' \
'on view/inactive account!',
})
self._order.insert(0, ('date', 'ASC'))
def default_currency(self, cursor, user, context=None):