Prevent exception in on_change_party of move if party has not receivable nor
payable account for issue891
This commit is contained in:
1 parent
6198196062
commit
9f50ff257e
1 file changed
+4
@@ -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(' \
|
||||
|
||||
Reference in new issue
Block a user