From e62530c6cb1e9cffaa39ddcbb9eef0821b243bd5 Mon Sep 17 00:00:00 2001 From: Bertrand Chenal Date: Fri, 13 Jun 2008 17:33:21 +0200 Subject: [PATCH 1/3] Added handling for non-list ids on unlink of account move. --- move.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/move.py b/move.py index 7e4bbae7aa..a5ba03df98 100644 --- a/move.py +++ b/move.py @@ -154,6 +154,8 @@ class Move(OSV): return res def unlink(self, cursor, user, ids, context=None): + if isinstance(ids, (int, long)): + ids = [ids] move_line_obj = self.pool.get('account.move.line') for move in self.browse(cursor, user, ids, context=context): if move.state == 'posted': From 5aa3eb9dc53c315b24b31265fcb5ef4cd6a7c43d Mon Sep 17 00:00:00 2001 From: Bertrand Chenal Date: Fri, 13 Jun 2008 17:33:56 +0200 Subject: [PATCH 2/3] Added non-negative constraint for amount second currency on move line. --- move.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/move.py b/move.py index a5ba03df98..9984686ff2 100644 --- a/move.py +++ b/move.py @@ -386,6 +386,9 @@ class Line(OSV): ('credit_debit', 'CHECK((credit * debit = 0.0) AND (credit + debit >= 0.0))', 'Wrong credit/debit values!'), + ('check_amount_second_currency', + 'CHECK(amount_second_currency >= 0.0)', + 'Amount Second Currency mus tbe Positive!'), ] self._constraints += [ ('check_account', 'You can not create move line \n' \ From c1b6fff8f6e0c39f70663ed616bc48002b01c9d0 Mon Sep 17 00:00:00 2001 From: Bertrand Chenal Date: Fri, 13 Jun 2008 17:49:21 +0200 Subject: [PATCH 3/3] Typo. --- move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/move.py b/move.py index 9984686ff2..a6658cd7f3 100644 --- a/move.py +++ b/move.py @@ -388,7 +388,7 @@ class Line(OSV): 'Wrong credit/debit values!'), ('check_amount_second_currency', 'CHECK(amount_second_currency >= 0.0)', - 'Amount Second Currency mus tbe Positive!'), + 'Amount Second Currency must be positive!'), ] self._constraints += [ ('check_account', 'You can not create move line \n' \