[FIX]Fixed some traceback.

Fixed following error: 
->Invalid field 'type' in leaf in bank account ,
->syntax error at or near "GROUP" in partner form view.,
->global name 'uid' is not defined in refund invoice.