Prevent exception in on_change_party of move if party has not receivable nor

payable account for issue891
This commit is contained in:
Cédric Krier committed 2009-03-22 23:36:25 +01:00
1 parent 6198196062
commit 9f50ff257e
1 file changed
+4
+4
View File
@@ -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(' \