From 1140f51d81219aa773c96ededa2eb617cc923feb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 22 Sep 2008 18:45:22 +0200 Subject: [PATCH] Disable write on deferral --- account.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/account.py b/account.py index 42583292e3..36e1863aba 100644 --- a/account.py +++ b/account.py @@ -797,6 +797,9 @@ class AccountDeferral(OSV): ('deferral_uniq', 'UNIQUE(account, fiscalyear)', 'Deferral must be unique by account and fiscal year'), ] + self._error_messages.update({ + 'write_deferral': 'You can not modify Account Deferral records', + }) def get_currency_digits(self, cursor, user, ids, name, arg, context=None): res = {} @@ -824,6 +827,9 @@ class AccountDeferral(OSV): res = self.name_get(cursor, user, ids, context=context) return res + def write(self, cursor, user, ids, vals, context=None): + self.raise_user_error(cursor, 'write_deferral', context=context) + AccountDeferral()