From 94053d161edb00b5ef52c5cd8b10601ef2e1413f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 22 Nov 2012 23:24:24 +0100 Subject: [PATCH] Fix on_change_party when no journal is set issue2883 review596002 --- move.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/move.py b/move.py index 842a19b044..c394b9ee6b 100644 --- a/move.py +++ b/move.py @@ -936,8 +936,11 @@ class Line(ModelSQL, ModelView): res['account.rec_name'] = \ self.party.account_receivable.rec_name - journal = (self.journal - or Journal(Transaction().context.get('journal'))) + journal = None + if self.journal: + journal = self.journal + elif Transaction().context.get('journal'): + journal = Journal(Transaction().context.get('journal')) if journal and self.party: if journal.type == 'revenue': if 'account' not in res: