From fd398bdecc5a0acd57d9c4d44cf8231ede394979 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 (transplanted from 77785714779638819241a6e166b85e3821973cee) --- 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: