@classmethod
def copy_account(cls, account):
    suffix_nb = 1
    while True:
        new_code = ('%s (%s)' % (account.code, suffix_nb))
        if account.search_count([('company_id', '=', account.company_id.id), ('code', '=', new_code)]):
            suffix_nb += 1
        else:
            return account.copy(default={'code': new_code})
@classmethod
def copy_account(cls, account):
    suffix_nb = 1
    while True:
        new_code = ('%s (%s)' % (account.code, suffix_nb))
        if account.search_count([('company_id', '=', account.company_id.id), ('code', '=', new_code)]):
            suffix_nb += 1
        else:
            return account.copy(default={'code': new_code})