""" Does basically the same thing as account_move.post
in module 'account' except that the object is posted as
a draft.
Note: I replaced all references to 'self' with 'mov_obj'.
Also the 'update' query was removed, see comment below.
"""
ifcontextisNone:
context={}
invoice=context.get('invoice',False)
valid_moves=mov_obj.validate(cr,uid,ids,context)
ifnotvalid_moves:
raiseosv.except_osv(_('Error!'),_('You cannot validate a non-balanced entry.\nMake sure you have configured payment terms properly.\nThe latest payment term line should be of the "Balance" type.'))