From 9f50ff257e0ffac3f138e9dd10cfab1aea70d219 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 22 Mar 2009 23:36:25 +0100 Subject: [PATCH] Prevent exception in on_change_party of move if party has not receivable nor payable account for issue891 --- move.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/move.py b/move.py index 1bfb6b7250..0f890c03ab 100644 --- a/move.py +++ b/move.py @@ -812,6 +812,10 @@ class Line(ModelSQL, ModelView): party = party_obj.browse(cursor, user, vals.get('party'), context=context) + if not party.account_receivable \ + or not party.account_payable: + return res + if party and (not vals.get('debit')) and (not vals.get('credit')): query = 'SELECT ' \ 'COALESCE(SUM(' \